TorchLean API

NN.Proofs.RuntimeApprox.IEEE32.Expressions

Scalar expression refinement #

toReal_evalRuntime_eq_evalSpec composes FloatLib's arithmetic refinement results along an Expr tree. evalRuntime uses encoded binary32 operations; evalSpec rounds each real operation with Model.roundAt FloatFormat.binary32. Fused multiply-add rounds once, not after its product.

The theorem requires a FiniteEval witness for every intermediate result, including finite leaves and a nonzero divisor. Subnormals and underflow to zero are allowed. The decoded real equality does not distinguish signed zeros or establish native CPU/GPU kernel correspondence.

References / background (for the rounding model itself, not this AST wrapper):

A small scalar expression language #

Expr is a small, scalar-only AST. TorchLean's main IRs live elsewhere; this wrapper exists to state expression-level refinement theorems for straight-line float32 computations.

A compact AST for scalar float32 expressions evaluated using ExecFloat.Binary 8 23.

Instances For

    Real semantics for the compact scalar expression language.

    Instances For

      "Finite evaluation" witnesses (finite at every intermediate node) #

      The arithmetic adapter bridges finite ExecFloat.Binary 8 23 behavior to binary32 rounding on the reals. For expression-level statements, every intermediate evaluation must remain finite.

      FiniteEval env e d records the result's decoded dyadic d and finite-evaluation witnesses for every subtree. A successful toDyadic? observation rules out NaN and infinity.

      Finite-evaluation witness for the compact scalar expression language.

      Instances For

        Whole-expression refinement #

        Induction on FiniteEval applies the arithmetic refinement theorem at each operation.