interval.pl : Interval domains over integer and real
Reasoning about real and integer intervals is provided including intersection, addition, multiplication, comparison and labelling.

How to use:
For unbound variables X, Y and Z and evaluable (i.e. ground) arithmetic expressions (or numbers) A and B the following constraints are supported:
- X::A:B X is between numbers A and B, inclusively (X element of [A,B])
- X le Y X is smaller or equal Y (X =< Y)
- X eq Y X is equal Y (X = Y)
- X ne Y X is not equal Y (X \= Y)
- add(X,Y,Z) X + Y = Z
- mult(X,Y,Z) X * Y = Z
- int(X) X is an integer
- bool(X) X is boolean (0 or 1)
- split0(X) for X::A:B (A<0<B) cases X::A:0 and X::0:B are distinguished
- split(X) for X::A:B cases X::A:M and X::M:B (M=(A+B)/2) are discerned
- label(X) split(X) is applied repeatedly until interval is too small

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

 Select example query: (Clear query) X::3:5, X::2:4. X le Y, X::3:5, Y::2:4. add(X,Y,Z), X::2:5, Y::3:4, Z::1:7. mult(X,Y,Z), X:: -2:3, Y:: -3:4, Z:: -12: -9. A::(-3):3, B::(-3):3, C::4:4, mult(A,B,C), A eq B, label(A). int(A),int(B),int(C), mult(A,B,C), A::0:0.3, B::0:0.3, C::0:0.3, A eq B, B eq C.

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007