10.34.2.1 Posting Constraints

A constraint is called as any other Prolog predicate. When called, the constraint is posted to the store. For example:

     | ?- X in 1..5, Y in 2..8, X+Y #= T.
     X in 1..5,
     Y in 2..8,
     T in 3..13
     
     | ?- X in 1..5, T in 3..13, X+Y #= T.
     X in 1..5,
     T in 3..13,
     Y in -2..12

Note that the answer constraint shows the domains of nonground query variables, but not any constraints that may be attached to them.


Send feedback on this subject.