Encoded numerical formats #
EncodedFormat F assigns a code type and finite scalar domain to a format identity F.
Codes can be machine words, limb records, blocks, codebook indices, or runtime-sized values.
FormatSemantics F supplies the denotation separately. A real-valued denotation can then be
noncomputable while storage and arithmetic remain executable. Together the classes define a
NumericalSystem; optional capabilities add laws and operations as needed.
These interfaces also cover representations without a radix/exponent description. For the radix-based generic-format approach, see Boldo and Melquiond, Flocq: A Unified Library for Proving Floating-Point Algorithms in Coq (2011), https://doi.org/10.1109/ARITH.2011.40.
Complete semantic interpretation of a format's runtime codes.
- denote : EncodedFormat.Code F → NumericalValue (EncodedFormat.Scalar F)
Meaning of every code, including infinities and exceptional values.
Instances
Runtime storage selected by F.
Instances For
Ordinary finite semantic domain selected by F.
Instances For
Build format semantics when every stored code has an ordinary finite interpretation.
Instances For
Complete interpretation of one code in F.
Instances For
The general numerical system assembled from a format's storage and denotation.
The wrapper is reducible so Lean can reuse structures on FormatCode F and FormatScalar F
through NumericalSystem.Code and NumericalSystem.Scalar without forwarding instances.
Instances For
A format code represents the ordinary scalar value.
Instances For
Optional rich exact semantics for a type-directed format.
This capability is proof-facing. Executable kernels should call concrete family decoders rather
than project through exactSemantics in an arithmetic loop.
- exactSemantics : ExactSemantics (formatSystem F)
Exact interpretation and its coherence theorem for
F.