Relational quantization specifications #
Quantization is not, in general, a function from one scalar to one stored code. A result may depend on a block scale, an exception policy, an entropy stream, a status accumulator, or a format-specific tie rule. Some specifications intentionally permit several results before an implementation fixes one.
Spec Context Exact Result is therefore the relation
Context → Exact → Result → Prop
used to specify these choices. Deterministic reference functions and executable kernels are ordinary functions proved to satisfy the relation.
This separation follows the distinction between representability and rounding used in generic floating-point libraries. In particular, Flocq defines format membership independently from rounding operators; see S. Boldo and G. Melquiond, “Flocq: A Unified Library for Proving Floating-Point Algorithms in Coq,” ARITH 2011, DOI 10.1109/ARITH.2011.40.
A context-indexed relation describing the permitted result of quantizing an exact input.
Context, Exact, and Result are deliberately arbitrary. For example, Context may contain a
shared exponent or entropy state, while Result may be a code, a code/status pair, or an updated
entropy state together with a code.
Instances For
The reference function implements its singleton relational specification.
A singleton relational specification is total.
A singleton relational specification is deterministic.
Map every permitted result through a pure post-processing function.
An output is permitted exactly when it is the image of a permitted source result. This is a proposition about the output; it adds no runtime wrapper.
Instances For
Post-processing a conforming implementation preserves conformance.
Mapping the unique result of a deterministic relation remains deterministic.
Relational specification saying that a result code represents the scalar selected by target.
This is the bridge from context-dependent rounding to the common NumericalSystem
representability predicate.
Instances For
A code-valued kernel implements represents exactly when every result represents its target.