[ library(cardinal) | Reference Manual | Alphabetic Index ]

refine(++UpDown, ?SetVar)

Refine a set variable's domain
UpDown
Atom ('up' or 'down').
SetVar
A set variable.

Description

Pick the first element of SetVar's poss (lub\glb) and try to include it in its glb, or to definitely exclude it from the domain.

If heuristic UpDown is 'up' then inclusion is tried first; otherwise (down) exclusion is tried first.

Fail Conditions

Fails if Var can not be refined (it is either ground or both the inclusion and exclusion of the first element of its poss leads to a failure due to unsatisfied constraints).

Resatisfiable

Yes.

Examples

?- S `:: [a]+[b,c], refine(up,S), glb_poss(S,G,P).
G = [a,b], P = [c] ;
G = [a], P = [c] ;
no

?- S `:: [a]+[b,c], refine(down,S), glb_poss(S,G,P).
G = [a], P = [c] ;
G = [a,b], P = [c] ;
no

See Also

set_labeling / 2, set_labeling / 1