TorchLean API

FloatLib.Floats.Formats.Posit.Semantics.Ordinary

Ordinary posit values as exact rationals #

The NaR encoding has no rational denotation. Excluding it gives a subtype on which exact rational decoding is total.

No alternate encoding is introduced: Model.Ordinary format is a proof-carrying view of the same encoded word. The full posit order still belongs to Model format; the rational coordinate here is available for every value of the subtype.

@[reducible, inline]

A posit word accompanied by proof that it is not the unique NaR encoding.

Instances For

    The optional exact semantics of an ordinary posit is inhabited.

    @[inline]

    Total exact rational semantics of an ordinary posit.

    The proof argument to Option.get is erased at runtime. It records that the only absent rational meaning belongs to NaR, which the subtype excludes.

    Instances For
      @[simp]

      Forgetting the subtype and decoding recovers exactly the total rational coordinate.

      Ordinary zero, retaining proof that the zero word is not NaR.

      Instances For
        @[simp]

        The posit zero denotes the rational zero.