TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Configured

Configured binary values and literals #

Import this module to define a binary format by its exponent and fraction widths:

ExecFloat.Binary (exponentBits := 8) (fractionBits := 23)

Configured.Type owns the public type constructor, the modules below Configured.Storage own packed-carrier selection and codecs, and Configured.NativeDispatch plus Configured.Plan.Instances install certified operation backends. The value-facing implementation is separated further:

Configured.Transcendentals is a named import, not part of this module: it lifts the deterministic elementary-function kernels to this type. import FloatLib does not install ExecFloat.Binary.exp, Model.exp, Model.pow, or the binary MathFunctions instances.

Natural and scientific literals are rounded once from exact rationals into the destination format. They never pass through Lean's host Float, C double, or an IEEE bit-pattern parser.

Import FloatLib.Floats.Formats.BinaryInterchange.Info.Command when #float_info is also required.

References #

Plan #

Configured formats make two static decisions:

  1. StoragePlan chooses the persistent carrier from encoded width.
  2. This module chooses a certified kernel independently for each operation.

The implementation is split by responsibility:

All selection is structural. Word and pair kernels advertise explicit descriptor capabilities; layout-specific implementations remain specialized without testing catalogued format names. Every supported descriptor retains the generic kernel as a fallback.