[1,2]
(-inf,-2) (-1,1) (2,inf)
(-inf,2] [1.1,2.2) [4,inf)
{-1,0,1}
{0,1,[2,3),(3,4], (5,6), (7,inf)}
+,-,*,/,sq,unary -
I+J contains {x+y: x in X and y in Y} I*J contains {x*y: x in X and y in Y} I-J contains {x-y: x in X and y in Y and y<>0} I/J contains {x/y: x in X and y in Y} sq(I) contains {x*x: x in X} -I contains {-x: x in X}
VARIABLE := EXPRESSION
FUNNAME(V1,...,Vn) := EXPRESSION
FUNNAME(V) := { EXPR1 if V in I1 , EXPR2 if V in I2 , ... EXPRN if V in In }This definition intersects the interval argument V with each I_j to get V_j. If V_j is not empty, then it uses it to evaluate EXPRj to get a result interval R_j. The union of all R_j is returned. Note that one can use this to define functions recursively, but must take care to avoid infinite loops. The interpreter should probably memoize recursive calls to catch infinite loops, but it does not.