Rational contracts for bounded fixed point #
The bounded carrier denotes the subset of the unbounded fixed-point grid whose coefficients fit the signed storage width. This module defines the mathematical contract for three overflow policies:
- wrapping operations use centered reduction of the exact coefficient;
- checked operations are exact when the destination coefficient fits;
- saturating operations clamp the exact coefficient to the signed destination range.
The executable BitVec kernels live in Bounded.Core. Their refinement proofs are isolated in
Semantics.Proof, keeping the contract reusable without importing the proof implementation.
Rational value represented by an integer coefficient at one fixed scale.
Instances For
Recover the nearest integer coefficient of a rational scalar at one fixed scale.
This is exact on every scalar represented by the bounded fixed-point system.
Instances For
Wrapping same-scale addition on scalar values.
Instances For
Wrapping same-scale subtraction on scalar values.
Instances For
Wrapping multiplication on scalar values at the composed output scale.
Instances For
Saturating same-scale addition on scalar values.
Instances For
Saturating same-scale subtraction on scalar values.
Instances For
Saturating multiplication on scalar values at the composed output scale.
Instances For
Forgetting the coefficient bound yields the corresponding exact fixed-point code.
Instances For
Bounded fixed point interpreted as an exact rational numerical system.
Instances For
A bounded code with an erased proof of its complete denotation.
Instances For
A bounded code with an erased proof of its exact rational value.