Documentation

Complexitylib.Circuits.Encoding.FixedWidth.Codec.Defs

Fixed-width binary circuit-description codec -- definitions #

This module flattens bounded gate-slot descriptions into one Boolean cube. Gate slots have a total fixed-width codec. Description decoding is partial only because the count word can represent values above gateBound.

def Complexity.CircuitCode.FixedWidth.GateSlot.encode {width : } (slot : GateSlot width) :
BitString (3 + (width + width))

Flatten one gate slot into its three control bits followed by its two little-endian reference words.

Equations
Instances For
    def Complexity.CircuitCode.FixedWidth.GateSlot.decode {width : } (bits : BitString (3 + (width + width))) :
    GateSlot width

    Split one fixed-width gate-slot word into its structural fields.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Complexity.CircuitCode.FixedWidth.Description.encode {inputWidth gateBound : } (description : Description inputWidth gateBound) :
      BitString (codeWidth inputWidth gateBound)

      Flatten a bounded description into its count word followed by all gate slots in row-major order.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Complexity.CircuitCode.FixedWidth.Description.countBits {inputWidth gateBound : } (code : BitString (codeWidth inputWidth gateBound)) :

        Extract the leading fixed-width gate-count word.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Complexity.CircuitCode.FixedWidth.Description.slotBits {inputWidth gateBound : } (code : BitString (codeWidth inputWidth gateBound)) (slot : Fin gateBound) :
          BitString (gateSlotWidth inputWidth gateBound)

          Extract one fixed-width gate slot from a flattened description.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Complexity.CircuitCode.FixedWidth.Description.countValue {inputWidth gateBound : } (code : BitString (codeWidth inputWidth gateBound)) :

            Natural value represented by the leading little-endian count word.

            Equations
            Instances For
              def Complexity.CircuitCode.FixedWidth.Description.decode? {inputWidth gateBound : } (code : BitString (codeWidth inputWidth gateBound)) :
              Option (Description inputWidth gateBound)

              Decode one flattened description, rejecting exactly the out-of-range gate-count words.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For