Next: Finite Domains (III)
Up: Adding Computation Domains: CLP
Previous: Finite Domains (I)
-
- Example:
-
- ?- X #= A + B, A::1..3, B::3..7.
X::4..10, A::1..3, B::3..7, X #= A + B
-
- The respective minimums and maximums are added
-
- There is no unique solution
-
- ?- X #= A - B, A::1..3, B::3..7.
X::-6..0, A::1..3, B::3..7, X #= A - B
-
- The minimum value of X is the minimum value of A
minus the maximum value of B
-
- (Similar for the maximum values)
-
- Putting more constraints:
-
- ?- X #= A - B, A::1..3, B::3..7, X #>= 0.
A = 3, B = 3, X = 0
Last modification: Thu Oct 7 12:04:03 MEST 1999 <webmaster@clip.dia.fi.upm.es>