TorchLean API

FloatLib.Floats.ExecFloat.Backends.TinyTable.Generic.Certified

Specification-carrying generic byte-table kernels #

These structures retain the model operation used to generate each lazy table together with its refinement theorem. Their executable run methods delegate to the arity-specific direct lookup paths, while their equations compose the generic lookup proof with the reference definition.

structure FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedBinary {Model : Type u} (encoding : Encoding Model) (spec : ModelModelModel) :

A lazily memoized binary table certified against a reference model specification.

  • model : ModelModelModel

    Operation used to generate the table.

  • Lazy table generated from model.

  • table_eq : self.table.get = binaryTotal encoding self.model

    The table and its declared model agree definitionally or by proof.

  • model_eq_spec (left right : Model) : self.model left right = spec left right

    The generation model equals the reference definition.

Instances For
    def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedBinary.ofModel {Model : Type u} {spec : ModelModelModel} (encoding : Encoding Model) (model : ModelModelModel) (model_eq_spec : ∀ (left right : Model), model left right = spec left right) :
    CertifiedBinary encoding spec

    Create a certified binary kernel whose table is generated lazily from its reference model.

    The named constructor lets format packages use its table equation without unfolding the model operation. The definition remains transparent to Lean.

    Instances For
      @[inline]
      def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedBinary.run {Model : Type u} {encoding : Encoding Model} {spec : ModelModelModel} (kernel : CertifiedBinary encoding spec) (left right : Code encoding) :
      Code encoding

      Execute a certified binary table kernel on two encoded operands.

      Instances For
        @[simp]
        theorem FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedBinary.decodeCode_run {Model : Type u} {encoding : Encoding Model} {spec : ModelModelModel} (kernel : CertifiedBinary encoding spec) (left right : Code encoding) :
        encoding.decodeCode (kernel.run left right) = spec (encoding.decodeCode left) (encoding.decodeCode right)

        Decoding certified binary execution yields the reference binary specification.

        structure FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedUnary {Model : Type u} (encoding : Encoding Model) (spec : ModelModel) :

        A lazily memoized unary table certified against a reference model specification.

        • model : ModelModel

          Operation used to generate the table.

        • Lazy table generated from model.

        • table_eq : self.table.get = unaryTotal encoding self.model

          The table and its declared model agree.

        • model_eq_spec (value : Model) : self.model value = spec value

          The generation model equals the reference definition.

        Instances For
          def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedUnary.ofModel {Model : Type u} {spec : ModelModel} (encoding : Encoding Model) (model : ModelModel) (model_eq_spec : ∀ (value : Model), model value = spec value) :
          CertifiedUnary encoding spec

          Create a certified unary kernel whose table is generated lazily from its reference model.

          Instances For
            @[inline]
            def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedUnary.run {Model : Type u} {encoding : Encoding Model} {spec : ModelModel} (kernel : CertifiedUnary encoding spec) (value : Code encoding) :
            Code encoding

            Execute a certified unary table kernel on one encoded operand.

            Instances For
              @[simp]
              theorem FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedUnary.decodeCode_run {Model : Type u} {encoding : Encoding Model} {spec : ModelModel} (kernel : CertifiedUnary encoding spec) (value : Code encoding) :
              encoding.decodeCode (kernel.run value) = spec (encoding.decodeCode value)

              Decoding certified unary execution yields the reference unary specification.

              structure FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedTernary {Model : Type u} (encoding : Encoding Model) (spec : ModelModelModelModel) :

              A lazily memoized ternary table certified against a reference model specification.

              • model : ModelModelModelModel

                Operation used to generate the table.

              • Lazy table generated from model.

              • table_eq : self.table.get = ternaryTotal encoding self.model

                The table and its declared model agree.

              • model_eq_spec (left right addend : Model) : self.model left right addend = spec left right addend

                The generation model equals the reference definition.

              Instances For
                def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedTernary.ofModel {Model : Type u} {spec : ModelModelModelModel} (encoding : Encoding Model) (model : ModelModelModelModel) (model_eq_spec : ∀ (left right addend : Model), model left right addend = spec left right addend) :
                CertifiedTernary encoding spec

                Create a certified ternary kernel whose table is generated lazily from its reference model.

                Instances For
                  @[inline]
                  def FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedTernary.run {Model : Type u} {encoding : Encoding Model} {spec : ModelModelModelModel} (kernel : CertifiedTernary encoding spec) (left right addend : Code encoding) :
                  Code encoding

                  Execute a certified ternary table kernel on three encoded operands.

                  Instances For
                    @[simp]
                    theorem FloatLib.Floats.ExecFloat.Backend.TinyTable.CertifiedTernary.decodeCode_run {Model : Type u} {encoding : Encoding Model} {spec : ModelModelModelModel} (kernel : CertifiedTernary encoding spec) (left right addend : Code encoding) :
                    encoding.decodeCode (kernel.run left right addend) = spec (encoding.decodeCode left) (encoding.decodeCode right) (encoding.decodeCode addend)

                    Decoding certified ternary execution yields the reference ternary specification.