miniKanren's key semantic advance over Prolog is to implement a complete yet efficient search strategy, fairly interleaving execution between disjuncts. This fairness is accomplished by bounding how much work is done exploring one disjunct before switching to the next. We show that the same idea -- fairness via bounded work -- underlies an elegant compositional approach to implementing worst-case optimal joins using a seekable iterator interface, suitable for shallow embedding in functional languages.
翻译:miniKanren相较于Prolog的关键语义进展在于实现了一种完备且高效的搜索策略,能够公平地在析取分支间交错执行。这种公平性通过限制在切换至下一个分支前对单个分支的探索工作量来实现。我们证明,同样的思想——通过有界工作量实现公平性——构成了使用可寻址迭代器接口实现最坏情况最优连接的优雅组合方法的基础,该方法适用于函数式语言的浅层嵌入。