Abstract

We describe the introduction of disequality constraints over algebraic data terms in the functional logic language Curry, and their implementation in Sloth, our Curry compiler. This addition extends the standard definition of Curry in several ways. On one hand, we provide a disequality counterpart to the constraint equality operator (=:=). Secondly, boolean equality operators are also redefined to cope with constructive disequality information, which leads to a more symmetric design w.r.t. the existing one. Semantically speaking, our implementation is very similar to previous proposals, although there are some novel aspects. One of them is that the implementation is partly based on an existing finite domain (FD) constraint solver, which provides a more efficient execution in some examples and, more important, the first complete implementation of disequality constraints over finite types. A detailed description of the finite type case is provided, including: i) the use of the FD solver; ii) an algorithm for analysing cardinality of types, and iii) how to deal with cardinality information at run time. Some benchmarks, an operational semantics minimally extending the one in the Curry draft, and a moderately detailed description of the implementation complete the paper.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call