We describe the design and implementation of a finite domain constraint solver embedded in a Prolog system using an extended unification mechanism via attributed variables as a generic constraint interface. The solver is essentially a scheduler for indexicals, i.e. reactive functional rules encoding local consistency methods performing incremental constraint solving or entailment checking, and global constraints, i.e. general propagators which may use specialized algorithms to achieve a higher degree of consistency or better time and space complexity. The solver has an open-ended design: the user can introduce new constraints, either in terms of indexicals by writing rules in a functional notation, or as global constraints via a Prolog programming interface. Constraints defined in terms of indexicals can be linked to 0/1-variables modeling entailment; thus indexicals are used for constraint solving as well as for entailment testing. Constraints can be arbitrarily combined using the propositional connectives by automatic expansion to systems of reified constraints.
We present two schemes for compiling disjunctions of nite domain constraints, where disjunction is treated as constructive. In the rst scheme each disjunction is compiled to a set of indexicals, i.e. a set of range functions computing domain restrictions, such that the evaluation of the indexicals maintains a weak form of consistency of the disjunction. The second scheme is based on constraint lifting, i.e. constructive disjunction applied to the set of constraint stores given by executing a disjunction of goals, for which we provide an algorithm for lifting nite domain constraints. This scheme maintains stronger consistency than the rst with a penalty in e ciency. We compare the two schemes with speculative disjunction, i.e. disjunction executed nondeterministically, and with disjunction via cardinality. Our conclusions are that the indexical scheme implements the most e cient pruning for many disjunctive constraints, such as resource and maximum/minimum constraints, and that the lifting scheme can be used for implementing lookahead pruning.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.