pith. sign in

arxiv: 1607.01590 · v1 · pith:JTEBYEGInew · submitted 2016-07-06 · 💻 cs.PL

Indexing dif/2

classification 💻 cs.PL
keywords impuredefinitionsindexinginequalityprogramsableadequateanswers
0
0 comments X
read the original abstract

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.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.