A range expression has one of the following forms, where R_i denote range expressions, T_i denote integer valued term expressions, S(T_i) denotes the integer value of T_i in S, X denotes a variable, I denotes an integer, and S denotes the current store.
dom(X)
{T_1,\ldots,T_n}
unionof/3
will
cause the indexical to suspend until this variable has been assigned.
T_1..T_2
R_1/\R_2
R_1\/R_2
\R_2
R_1+R_2
R_1+T_2
-R_2
R_1-R_2
R_1-T_2
T_1-R_2
R_1 mod R_2
R_1 mod T_2
R_1 ? R_2
(R_1 ? (inf..sup) \/ R_3)
, which evaluates to
S(R_3) if S(R_1) is an empty set; otherwise, evaluates to
inf..sup
. As an optimization, R_3 is not evaluated
while the value of R_1 is a non-empty set.
unionof(X,R_1,R_2)
Please note: if S(R_1) is infinite, the evaluation of the indexical will be abandoned, and the indexical will simply suspend.
switch(T,
MapList)
K-E
.
Otherwise, evaluates to the empty set. If T contains a
variable that is not "quantified" by unionof/3
, the
indexical will suspend until this variable has been assigned.
When used in the body of an FD predicate (see Goal Expanded Constraints), a relation/3
expression expands to two
indexicals, each consisting of a switch/2
expression nested
inside a unionof/3
expression. Thus, the following constraints
are equivalent:
p(X, Y) +: relation(X, [1-{1},2-{1,2},3-{1,2,3}], Y). q(X, Y) +: X in unionof(B,dom(Y),switch(B,[1-{1,2,3},2-{2,3},3-{3}])), Y in unionof(B,dom(X),switch(B,[1-{1},2-{1,2},3-{1,2,3}])).