Confluence and Semantics of Constraint Simplification Rules

Constraints (Impact Factor: 1.26). 03/1998; 4(2). DOI: 10.1023/A:1009842826135
Source: DBLP


Constraint Simplification Rules (CSR) is a subset of the Constraint Handling Rules (CHR) language. CHR is a powerful special-purpose declarative programming language for writing constraint solvers. The CSR subset of CHR forms essentially a committed-choice language consisting of guarded rules with multiple heads that replace constraints by simpler ones until they are solved. This paper gives declarative and operational semantics as well as soundness and completeness results for CSR programs.
We also introduce a notion of confluence for CSR programs. Confluence is an essential syntactical property of any constraint solver. It ensures that the solver will always compute the same result for a given set of constraints independent of which rules are applied. It also means that it does not matter for the result in which order the constraints arrive at the constraint solver.
We give a decidable, sufficient and necessary syntactic condition for confluence of terminating CSR programs. Moreover, as shown in this paper, confluence of a program implies consistency of its logical meaning (under a mild restriction).

Download full-text


Available from: Slim Abdennadher, Feb 21, 2013
  • Source
    • "If a program P is both locally confluent and terminating, then P is confluent (Newman 1942). Confluence implies logical consistency of P (Abdennadher et al. 1999; Haemmerlé et al. 2011). That is, the logical reading of P does not imply false. "
    [Show abstract] [Hide abstract]
    ABSTRACT: We consider the application of Constraint Handling Rules (CHR) for the specification of type inference systems, such as that used by Haskell. Confluence of CHR guarantees that the answer provided by type inference is correct and consistent. The standard method for establishing confluence relies on an assumption that the CHR program is terminating. However, many examples in practice give rise to non-terminating CHR programs, rendering this method inapplicable. Despite no guarantee of termination or confluence, the Glasgow Haskell Compiler (GHC) supports options that allow the user to proceed with type inference anyway, e.g. via the use of the UndecidableInstances flag. In this paper we formally identify and verify a set of relaxed criteria, namely range-restrictedness, local confluence, and ground termination, that ensure the consistency of CHR-based type inference that maps to potentially non-terminating CHR programs.
    Full-text · Article · May 2014 · Theory and Practice of Logic Programming
  • Source
    • "We next present a theorem that uses fixpoints semantics to reformulate results on CSR logical semantics (Frühwirth 1998; Abdennadher et al. 1999). It says that a state that has at least one answer is in the inductive semantics of a confluent CSR program if and only if its logical reading is satisfiable within the theory CP. "
    [Show abstract] [Hide abstract]
    ABSTRACT: In this paper, we address the problem of defining a fixpoint semantics for Constraint Handling Rules (CHR) that captures the behavior of both simplification and propagation rules in a sound and complete way with respect to their declarative semantics. Firstly, we show that the logical reading of states with respect to a set of simplification rules can be characterized by a least fixpoint over the transition system generated by the abstract operational semantics of CHR. Similarly, we demonstrate that the logical reading of states with respect to a set of propagation rules can be characterized by a greatest fixpoint. Then, in order to take advantage of both types of rules without losing fixpoint characterization, we present an operational semantics with persistent. We finally establish that this semantics can be characterized by two nested fixpoints, and we show the resulting language is an elegant framework to program using coinductive reasoning.
    Preview · Article · Aug 2011 · Theory and Practice of Logic Programming
  • Source
    • "• The logical models of a CHR program are under-approximated by the least model of its projection. We show moreover that the least model of a confluent CHR program is precisely the least model of its CLP projection (closing hence a ten year-old conjecture by Abdenader et al. [1]). • The success set with respect a CHR program can be charaterized by the successes of its projection. "
    [Show abstract] [Hide abstract]
    ABSTRACT: This paper introduces and studies the notion of CLP projection for Constraint Handling Rules (CHR). The CLP projection consists of a naive translation of CHR programs into Constraint Logic Programs (CLP). We show that the CLP projection provides a safe operational and declarative approximation for CHR programs. We demonstrate moreover that a confluent CHR program has a least model, which is precisely equal to the least model of its CLP projection (closing hence a ten year-old conjecture by Abdenader et al.). Finally, we illustrate how the notion of CLP projection can be used in practice to apply CLP analyzers to CHR. In particular, we show results from applying AProVE to prove termination, and CiaoPP to infer both complexity upper bounds and types for CHR programs.
    Full-text · Conference Paper · Jan 2011
Show more