Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms

06/24/2017
by   Thom Fruehwirth, et al.
0

We present a straightforward source-to-source transformation that introduces justifications for user-defined constraints into the CHR programming language. Then a scheme of two rules suffices to allow for logical retraction (deletion, removal) of constraints during computation. Without the need to recompute from scratch, these rules remove not only the constraint but also undo all consequences of the rule applications that involved the constraint. We prove a confluence result concerning the rule scheme and show its correctness. When algorithms are written in CHR, constraints represent both data and operations. CHR is already incremental by nature, i.e. constraints can be added at runtime. Logical retraction adds decrementality. Hence any algorithm written in CHR with justifications will become fully dynamic. Operations can be undone and data can be removed at any point in the computation without compromising the correctness of the result. We present two classical examples of dynamic algorithms, written in our prototype implementation of CHR with justifications that is available online: maintaining the minimum of a changing set of numbers and shortest paths in a graph whose edges change.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/24/2000

Constraint Programming viewed as Rule-based Programming

We study here a natural situation when constraint programming can be ent...
research
06/30/2000

Constraint compiling into rules formalism constraint compiling into rules formalism for dynamic CSPs computing

In this paper we present a rule based formalism for filtering variables ...
research
05/22/2018

Rule-Based Drawing, Analysis and Generation of Graphs for Mason's Mark Design

We are developing a rule-based implementation of a tool to analyse and g...
research
09/08/1999

Automatic Generation of Constraint Propagation Algorithms for Small Finite Domains

We study here constraint satisfaction problems that are based on predefi...
research
07/05/2023

Runtime Repeated Recursion Unfolding: A Just-In-Time Online Program Optimization That Can Achieve Super-Linear Speedup

We introduce a just-in-time runtime program transformation based on repe...
research
05/05/2023

Finding the Right Way to Rome: Effect-oriented Graph Transformation

Many applications of graph transformation require rules that change a gr...
research
09/18/2019

Quantified Constraint Handling Rules

We shift the QCSP (Quantified Constraint Satisfaction Problems) framewor...

Please sign up or login with your details

Forgot password? Click here to reset