8.1 Getting Started

reification of a constraint

The reification of a constraint C with respect to a variable x is the constraint

(C \leftrightarrow x=1)
\;\land\;x\in0\#1

where it is assumed that x does not occur free in C.

The operational semantics of a propagator for the reification of a constraint C with respect to x is given by the following rules:

  1. If the constraint store entails x=1, the propagator for the reification reduces to a propagator for C.

  2. If the constraint store entails x=0, the propagator for the reification reduces to a propagator for \neg C}.

  3. If a propagator for C would realize that the constraint store entails C, the propagator for the reification tells x=1 and ceases to exist.

  4. If a propagator for C would realize that the constraint store is inconsistent with C, the propagator for the reification tells x=0 and ceases to exist.

To understand these rules, you need to be familiar with the definitions in Section 2.2.

0/1-variables

A 0/1-variable is a variable that is constrained to the finite domain 0\#1. The control variables of reified constraints are 0/1-variables.

posting refied constraints

Here are examples for statements creating propagators for reified constraints:

expressing equivalences

With reified constraints it is straightforward to express equivalences of constraints. For instance, the equivalence

X<Y\;\leftrightarrow\; X<Z

can be posted with the statement

X<:Y = X<:Z

This statement is a notational convenience for

local B in   
   X<:Y=B  X<:Z=B   
end

and creates 2 propagators for reified constraints.

Boolean connectives

We can define the Boolean connectives (e.g., conjunction or negation) by associating 0 with false and 1 with true. The respective Boolean constraints can be posted by means of the following procedures:

Exercises

Exercise 8.1 (See solution)

Write a statement that posts the constraint

(X<Y\;\to\; X+Y=Z)
\;\;\leftrightarrow\;\;
(X\cdot Y=Z\;\lor\;Z\neq 5)

Exercise 8.2 (See solution)

Write a procedure {Conj X Y Z} that posts the constraints

(X\land Y)=Z
,\quad
X\in0\#1
,\quad
Y\in0\#1

The procedure should post the conjunction (X\land Y)=Z. by means of the reified form of the infix operator =:.

Write analogous procedures Equi and Nega posting equivalences and negations.

Write an analogous procedure Dis posting a disjunction (X\lor Y)=Z. Use the reified form of <: to post the disjunction.

How would you write a procedure posting an implication (X\to Y)=Z?


Christian Schulte and Gert Smolka
Version 1.4.0 (20080702)