- Arithmetic operations on intervals:
+,-,*,/,sq,unary -
These all return an interval that contains all results, that is, if I and J are sets of
reals as above, then
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}
- Assignment statements separated by semicolons:
Each assignment must have the form
VARIABLE := EXPRESSION
- Function definitions
FUNNAME(V1,...,Vn) := EXPRESSION
- Piecewise function definitions
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.