A.4 Logical, conditional and reified constraints

Constraint JaCoP specification


¬c Not(c);
c1 c2 Eq(c1, c2);
c1 c2 ⋅⋅⋅cn PrimitiveConstraint[] c = {c1, c2, …cn};
And(c);
or
ArrayList c =
       new ArrayList();
c.add(c1); c.add(c2); …c.add(cn);
And(c);
c1 c2 ⋅⋅⋅cn PrimitiveConstraint[] c = {c1, c2, …cn};
Or(c);
or
ArrayList c =
       new ArrayList();
c.add(c1); c.add(c2); …c.add(cn);
Or(c);
a1 ... an b1 ... bm BooleanVar[] a = {a1, a2, …, an};
BooleanVar[] b = {b1, b2, …, bm};
BoolClause(a, b)
X in Dom In(X, Dom);
c B Reified(c, B);
c ⇔¬B Xor(c, B);
if c1 then c2 IfThen(c1, c2);
if c1 then c2 else c3 IfThenElse(c1, c2, c3);
Boolean operations on variables
BooleanVar[] b = {b1, b2, …, bn};
or
ArrayList b = new ArrayList
b.add(b1); b.add(b2); …b.add(bn);
BoolanVariable result = new BooleanVar(store, "result");
result = b1 b2 ⋅⋅⋅bn AndBool(b, result)
result = b1 b2 ⋅⋅⋅bn OrBool(b, result)
result = b1 b2⋅⋅⋅bn XorBool(b, result)
result = b1 b2 IfThenBool(b1, b2, result)
result = b1 == b2 == ⋅⋅⋅ == bn EqBool(b, result)