281 research outputs found
Towards a Generic Trace for Rule Based Constraint Reasoning
CHR is a very versatile programming language that allows programmers to
declaratively specify constraint solvers. An important part of the development
of such solvers is in their testing and debugging phases. Current CHR
implementations support those phases by offering tracing facilities with
limited information. In this report, we propose a new trace for CHR which
contains enough information to analyze any aspects of \CHRv\ execution at some
useful abstract level, common to several implementations. %a large family of
rule based solvers. This approach is based on the idea of generic trace. Such a
trace is formally defined as an extension of the semantics of
CHR. We show that it can be derived form the SWI Prolog CHR trace
CHR(PRISM)-based Probabilistic Logic Learning
PRISM is an extension of Prolog with probabilistic predicates and built-in
support for expectation-maximization learning. Constraint Handling Rules (CHR)
is a high-level programming language based on multi-headed multiset rewrite
rules.
In this paper, we introduce a new probabilistic logic formalism, called
CHRiSM, based on a combination of CHR and PRISM. It can be used for high-level
rapid prototyping of complex statistical models by means of "chance rules". The
underlying PRISM system can then be used for several probabilistic inference
tasks, including probability computation and parameter learning. We define the
CHRiSM language in terms of syntax and operational semantics, and illustrate it
with examples. We define the notion of ambiguous programs and define a
distribution semantics for unambiguous programs. Next, we describe an
implementation of CHRiSM, based on CHR(PRISM). We discuss the relation between
CHRiSM and other probabilistic logic programming languages, in particular PCHR.
Finally we identify potential application domains
Logical Algorithms meets CHR: A meta-complexity result for Constraint Handling Rules with rule priorities
This paper investigates the relationship between the Logical Algorithms
language (LA) of Ganzinger and McAllester and Constraint Handling Rules (CHR).
We present a translation schema from LA to CHR-rp: CHR with rule priorities,
and show that the meta-complexity theorem for LA can be applied to a subset of
CHR-rp via inverse translation. Inspired by the high-level implementation
proposal for Logical Algorithm by Ganzinger and McAllester and based on a new
scheduling algorithm, we propose an alternative implementation for CHR-rp that
gives strong complexity guarantees and results in a new and accurate
meta-complexity theorem for CHR-rp. It is furthermore shown that the
translation from Logical Algorithms to CHR-rp combined with the new CHR-rp
implementation, satisfies the required complexity for the Logical Algorithms
meta-complexity result to hold.Comment: To appear in Theory and Practice of Logic Programming (TPLP
On the Expressive Power of Multiple Heads in CHR
Constraint Handling Rules (CHR) is a committed-choice declarative language
which has been originally designed for writing constraint solvers and which is
nowadays a general purpose language. CHR programs consist of multi-headed
guarded rules which allow to rewrite constraints into simpler ones until a
solved form is reached. Many empirical evidences suggest that multiple heads
augment the expressive power of the language, however no formal result in this
direction has been proved, so far.
In the first part of this paper we analyze the Turing completeness of CHR
with respect to the underneath constraint theory. We prove that if the
constraint theory is powerful enough then restricting to single head rules does
not affect the Turing completeness of the language. On the other hand,
differently from the case of the multi-headed language, the single head CHR
language is not Turing powerful when the underlying signature (for the
constraint theory) does not contain function symbols.
In the second part we prove that, no matter which constraint theory is
considered, under some reasonable assumptions it is not possible to encode the
CHR language (with multi-headed rules) into a single headed language while
preserving the semantics of the programs. We also show that, under some
stronger assumptions, considering an increasing number of atoms in the head of
a rule augments the expressive power of the language.
These results provide a formal proof for the claim that multiple heads
augment the expressive power of the CHR language.Comment: v.6 Minor changes, new formulation of definitions, changed some
details in the proof
FreeCHR: An Algebraic Framework for CHR-Embeddings
We introduce the framework FreeCHR, which formalizes the embedding of
Constraint Handling Rules (CHR) into a host-language, using the concept of
initial algebra semantics from category theory, to establish a high-level
implementation scheme for CHR, as well as a common formalization for both
theory and practice. We propose a lifting of the syntax of CHR via an
endofunctor in the category Set and a lifting of the operational semantics,
using the free algebra, generated by the endofunctor. We then lift the very
abstract operational semantics of CHR into FreeCHR, and give proofs for
soundness and completeness w.r.t. their original definition.Comment: This is the extended version of a paper presented at the 7th
International Joint Conference on Rules and Reasoning (RuleML+RR 2023); minor
revision of section
CHR as grammar formalism. A first report
Grammars written as Constraint Handling Rules (CHR) can be executed as
efficient and robust bottom-up parsers that provide a straightforward,
non-backtracking treatment of ambiguity. Abduction with integrity constraints
as well as other dynamic hypothesis generation techniques fit naturally into
such grammars and are exemplified for anaphora resolution, coordination and
text interpretation.Comment: 12 pages. Presented at ERCIM Workshop on Constraints, Prague, Czech
Republic, June 18-20, 200
Decidability properties for fragments of CHR
We study the decidability of termination for two CHR dialects which,
similarly to the Datalog like languages, are defined by using a signature which
does not allow function symbols (of arity >0). Both languages allow the use of
the = built-in in the body of rules, thus are built on a host language that
supports unification. However each imposes one further restriction. The first
CHR dialect allows only range-restricted rules, that is, it does not allow the
use of variables in the body or in the guard of a rule if they do not appear in
the head. We show that the existence of an infinite computation is decidable
for this dialect. The second dialect instead limits the number of atoms in the
head of rules to one. We prove that in this case, the existence of a
terminating computation is decidable. These results show that both dialects are
strictly less expressive than Turing Machines. It is worth noting that the
language (without function symbols) without these restrictions is as expressive
as Turing Machines
- …