10 research outputs found
A compositional Semantics for CHR
Constraint Handling Rules (CHR) are a committed-choice declarative language
which has been designed for writing constraint solvers. A CHR program consists
of multi-headed guarded rules which allow one to rewrite constraints into
simpler ones until a solved form is reached.
CHR has received a considerable attention, both from the practical and from
the theoretical side. Nevertheless, due the use of multi-headed clauses, there
are several aspects of the CHR semantics which have not been clarified yet. In
particular, no compositional semantics for CHR has been defined so far.
In this paper we introduce a fix-point semantics which characterizes the
input/output behavior of a CHR program and which is and-compositional, that is,
which allows to retrieve the semantics of a conjunctive query from the
semantics of its components. Such a semantics can be used as a basis to define
incremental and modular analysis and verification tools
(Co-)Inductive semantics for Constraint Handling Rules
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.Comment: 17 page
A compositional semantics for CHR
Constraint Handling Rules (CHR) are a committed-choice declarative language which has been
designed for writing constraint solvers. A CHR program consists of multi-headed guarded rules
which allow one to rewrite constraints into simpler ones until a solved form is reached.
CHR has received a considerable attention, both from the practical and from the theoretical
side. Nevertheless, due the use of multi-headed clauses, there are several aspects of the CHR
semantics which have not been clarified yet. In particular, no compositional semantics for CHR
has been defined so far.
In this paper we introduce a fix-point semantics which characterizes the input/output behavior
of a CHR program and which is and-compositional, that is, which allows to retrieve the semantics
of a conjunctive query from the semantics of its components. Such a semantics can be used as a
basis to define incremental and modular analysis and verification tools
A compositional Semantics for CHR with propagation rules
Constraint Handling Rules (CHR) is a committed-choice declarative
language which has originally been designed for writing constraint solvers and which is nowadays a general purpose language.
In [7,11] a trace based, compositional semantics for CHR has been defined.
Such a compositional model uses as reference operational semantics the original \u201cnaive\u201d one [9] which, due to the propagation rule, admits trivial non-termination.
In this paper we extend the work of [7,11] by considering a more refined operational semantics which avoids trivial non-termination
Constraint handling rules. Compositional semantics and program transformation
This thesis intends to investigate two aspects of Constraint Handling Rules (CHR). It
proposes a compositional semantics and a technique for program transformation.
CHR is a concurrent committed-choice constraint logic programming language consisting
of guarded rules, which transform multi-sets of atomic formulas (constraints) into
simpler ones until exhaustion [FrĂĽ06] and it belongs to the declarative languages family.
It was initially designed for writing constraint solvers but it has recently also proven to be
a general purpose language, being as it is Turing equivalent [SSD05a].
Compositionality is the first CHR aspect to be considered. A trace based compositional
semantics for CHR was previously defined in [DGM05]. The reference operational
semantics for such a compositional model was the original operational semantics for CHR
which, due to the propagation rule, admits trivial non-termination.
In this thesis we extend the work of [DGM05] by introducing a more refined trace
based compositional semantics which also includes the history. The use of history is a
well-known technique in CHR which permits us to trace the application of propagation
rules and consequently it permits trivial non-termination avoidance [Abd97, DSGdlBH04].
Naturally, the reference operational semantics, of our new compositional one, uses history
to avoid trivial non-termination too.
Program transformation is the second CHR aspect to be considered, with particular
regard to the unfolding technique. Said technique is an appealing approach which allows
us to optimize a given program and in more detail to improve run-time efficiency or spaceconsumption.
Essentially it consists of a sequence of syntactic program manipulations
which preserve a kind of semantic equivalence called qualified answer [FrĂĽ98], between
the original program and the transformed ones. The unfolding technique is one of the
basic operations which is used by most program transformation systems. It consists in the
replacement of a procedure-call by its definition. In CHR every conjunction of constraints
can be considered as a procedure-call, every CHR rule can be considered as a procedure
and the body of said rule represents the definition of the call. While there is a large body
of literature on transformation and unfolding of sequential programs, very few papers
have addressed this issue for concurrent languages.
We define an unfolding rule, show its correctness and discuss some conditions in
which it can be used to delete an unfolded rule while preserving the meaning of the original
program. Finally, confluence and termination maintenance between the original and
transformed programs are shown.
This thesis is organized in the following manner. Chapter 1 gives some general notion
about CHR. Section 1.1 outlines the history of programming languages with particular
attention to CHR and related languages. Then, Section 1.2 introduces CHR using examples.
Section 1.3 gives some preliminaries which will be used during the thesis. Subsequentely,
Section 1.4 introduces the syntax and the operational and declarative semantics
for the first CHR language proposed. Finally, the methodologies to solve the problem of
trivial non-termination related to propagation rules are discussed in Section 1.5.
Chapter 2 introduces a compositional semantics for CHR where the propagation rules
are considered. In particular, Section 2.1 contains the definition of the semantics. Hence,
Section 2.2 presents the compositionality results. Afterwards Section 2.3 expounds upon
the correctness results.
Chapter 3 presents a particular program transformation known as unfolding. This
transformation needs a particular syntax called annotated which is introduced in Section
3.1 and its related modified operational semantics !0t is presented in Section 3.2.
Subsequently, Section 3.3 defines the unfolding rule and prove its correctness. Then, in
Section 3.4 the problems related to the replacement of a rule by its unfolded version are
discussed and this in turn gives a correctness condition which holds for a specific class of
rules. Section 3.5 proves that confluence and termination are preserved by the program
modifications introduced.
Finally, Chapter 4 concludes by discussing related works and directions for future
work