On Confluence of Constraint Handling Rules
ABSTRACT . We introduce the notion of confluence for Constraint Handling Rules (CHR), a powerful language for writing constraint solvers. With CHR one simplifies and solves constraints by applying rules. Confluence guarantees that a CHR program will always compute the same result for a given set of constraints independent of which rules are applied. We give a decidable, sufficient and necessary syntactic condition for confluence. Confluence turns out to be an essential syntactical property of CHR programs for two reasons. First, confluence implies correctness (as will be shown in this paper). In a correct CHR program, application of CHR rules preserves logical equivalence of the simplified constraints. Secondly, even when the program is already correct, confluence is highly desirable. Otherwise, given some constraints, one computation may detect their inconsistency while another one may just simplify them into a still complex constraint. As a side-effect, the paper also gives soundness and com...
- SourceAvailable from: psu.edu[Show abstract] [Hide abstract]
ABSTRACT: The programming language of Constraint Handling Rules (CHR) is gaining more and more popularity and this has motivated the development of new optimization techniques to be applied in implemen-tations of CHR. As for other logic programming languages, a program written CHR can be understood declaratively as a logical formula and as a procedural specification, and CHR has different tools for manual optimization at the procedural level whose application may (or may not) sacrifice the declarative reading. One such optimization is given by pas-sive declarations by means of which the search for rules to be applied can be optimized, perhaps changing which rules that are applied and in which order. A framework for analyzing the effect of passive declarations is presented in terms of a slightly abstract operational semantics which takes into account the effect of passive declarations. Based on it, we can give different classifications of the effect of some passive declarations that do not affect the logical semantics. This may be used for reasoning about manual optimizations as well as proposals for automatic strategies to be applied by a compiler for adding passive declarations.
- [Show abstract] [Hide abstract]
ABSTRACT: Constraint Handling Rules (CHR) allow one to specify and implement both propagation and simplification for user-defined constraints. Since a propagation rule is applicable again and again, we present in this paper for the first time an operational semantics for CHR that avoids the termination problem with propagation rules. In previous work [AFM96], a sufficient and necessary condition for the confluence of terminating simplification rules was given inspired by results about conditional term rewriting systems. Confluence ensures that the solver will always compute the same result for a given set of constraints independent of which rules are applied. The confluence of propagation rules was an open problem. This paper shows that we can also give a sufficient and a necessary condition for confluence of terminating CHR programs with propagation rules based on the more refined operational semantics.