Shared proofs for native normal operand pairs #
Several one-word kernels begin with the same operation: reject zero, subnormal, and exceptional
operands, then expose two normalized significands and their biased exponents. The executable
decoder remains in Small.Core.Runtime; this module proves its common contract once.
View records the exact generic decoder results together with the bounds needed by fixed-word
rounders. Multiplication and division can therefore focus on their different arithmetic without
repeating storage-field and exceptional-value arguments. No executable definition depends on this
proof layer.
Proof-facing view of two successfully decoded normal operands.
- sign : Bool
XOR of the operand signs, as supplied to multiplicative kernels.
- xExponent : UInt64
Biased exponent of the left operand.
- yExponent : UInt64
Biased exponent of the right operand.
- xMantissa : UInt64
Normalized significand of the left operand.
- yMantissa : UInt64
Normalized significand of the right operand.
The native sign calculation agrees with the model fields.
- xDecode : FiniteKernel.decode? x = some { sign := x.signBit, exponent := self.xExponent.toNat, mantissa := self.xMantissa.toNat }
The generic finite decoder sees the same left operand fields.
- yDecode : FiniteKernel.decode? y = some { sign := y.signBit, exponent := self.yExponent.toNat, mantissa := self.yMantissa.toNat }
The generic finite decoder sees the same right operand fields.
The left biased exponent is a nonzero stored exponent.
The right biased exponent is a nonzero stored exponent.
- xMantissaBounds : 2 ^ fmt.fracWidth ≤ self.xMantissa.toNat ∧ self.xMantissa.toNat < 2 ^ (fmt.fracWidth + 1)
The left significand has its implicit leading bit.
- yMantissaBounds : 2 ^ fmt.fracWidth ≤ self.yMantissa.toNat ∧ self.yMantissa.toNat < 2 ^ (fmt.fracWidth + 1)
The right significand has its implicit leading bit.
Instances For
A native normal field decode agrees with the generic finite decoder.
Extract the shared proof view from a successful native normal-pair callback.
The callback itself remains fully generic. Its caller receives the exact fields passed at runtime, their normalized bounds, and decoder equalities suitable for any binary operation.
Lift a certified normal-product callback to the generic finite multiplication kernel.
The shared view handles native decoding. The callback hypothesis is responsible only for the product representation and its final rounding.