// Last edited on 2000-03-20 22:46:58 by stolfi class Quant { // Computer representeation of the value of a real variable class Float extends double {}; // Finite `double' value class FloatN extends double {}; // Either a `Float' or `-oo' class FloatP extends double {}; // Either a `Float' or `+oo' class FloatI extends double {}; // Either a `Float' or `ħoo' boolean is_empty(); // Variable has no valid value. FloatN lo(); // Guaranteed lower bound for the variable. FloatP hi(); // Guaranteed upper bound for the variable. static Float mid(); // Approximate midpoint of range. static FloatI rad(); // Half-width of range. /* Let `X' be a continuous variable, and `x' a `Quant' object that represents the value of `X'. The following invariants are satisfied whenever `x.is_empty() == true': 1. `x.lo() < +oo' and `x.hi() > -oo'. 2. `x.lo() \leq X \leq y.lo()'. 3. `x.mid() > -oo' and `x.mid() < +oo' 4. `x.mid() - x.rad() \leq X \leq x.mid() + x.rad()' */ }