计算机科学 > 程序设计语言
[提交于 2016年7月7日]
标题:Indexing dif/2
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Many Prolog programs are unnecessarily impure because of inadequate means to express syntactic inequality. While the frequently provided built-in `dif/2` is able to correctly describe expected answers, its direct use in programs often leads to overly complex and inefficient definitions --- mainly due to the lack of adequate indexing mechanisms. We propose to overcome these problems by using a new predicate that subsumes both equality and inequality via reification. Code complexity is reduced with a monotonic, higher-order if-then-else construct based on `call/N`. For comparable correct uses of impure definitions, our approach is as determinate and similarly efficient as its impure counterparts.
提交历史
来自:Ulrich Neumerkel[v1] 2016年7月7日 星期四 00:00:00 UTC