Interval expressions and endpoint backends #
An expression records the numerical operations independently of its endpoint representation.
Backend supplies executable enclosures; its real-containment contract is stated in Real.
The same expression can therefore run with exact rational endpoints, an integer binary grid,
or a format-specific outward rounder.
Evaluation returns none when an input is missing or a backend cannot enclose an operation.
In particular, a backend may reject division across zero or an interval outside a function's
domain. Success is related to real evaluation by Expr.containsReal_eval?.
Instances For
Instances For
An executable rational enclosure for an operation with a fixed number of real arguments.
Constants have arity zero. Extension.Sound supplies its separate containment contract.
- arity : ℕ
Number of real arguments.
Enclose the operation, or reject an unsupported input domain.
Instances For
Adapt a constant enclosure to the common argument-list interface.
Instances For
Adapt a unary enclosure to the common argument-list interface.
Instances For
Unary operations supported by the common interval expression language.
- neg : UnaryOp
- abs : UnaryOp
- inv : UnaryOp
- pow (exponent : ℕ) : UnaryOp
- exp : UnaryOp
- log : UnaryOp
- sin : UnaryOp
- cos : UnaryOp
- tan : UnaryOp
- asin : UnaryOp
- acos : UnaryOp
- atan : UnaryOp
- sinh : UnaryOp
- cosh : UnaryOp
- tanh : UnaryOp
- sqrt : UnaryOp
Instances For
Instances For
Three-input operations supported by the common interval expression language.
- fma : TernaryOp
Instances For
Instances For
A real expression with rational constants, numbered variables, and registered calls.
- const (value : ℚ) : Expr
- var (index : ℕ) : Expr
- unary (op : UnaryOp) (arg : Expr) : Expr
- binary (op : BinaryOp) (left right : Expr) : Expr
- ternary (op : TernaryOp) (first second third : Expr) : Expr
- call (index : ℕ) (args : List Expr) : Expr
Instances For
Structural Boolean comparison, including registered argument lists.
Instances For
Build an addition expression; evaluation uses the selected backend.
Build a multiplication expression; evaluation uses the selected backend.
Executable interval operations for an endpoint representation.
The decoder identifies the exact rational value of each usable endpoint. Operations may work
directly on the representation without decoding intermediate results. Backend.Sound is the
separate proof contract required to use an evaluation in a theorem.
Exact rational interpretation of a finite endpoint.
Enclose a rational constant.
Enclose a unary operation, or reject its domain or unavailable output range.
Enclose a binary operation, or reject its domain or unavailable output range.
Enclose a three-input operation, or reject an unavailable output range.
Enclose a registered operation; unavailable indices must fail.
Instances For
Evaluate an expression with the selected backend and variable intervals.
The environment may be partial. Missing variables and failed operations propagate as none;
no default numerical value is substituted.