Documentation

Complexitylib.Circuits.InputPairing.Defs

Self-delimiting input-pair circuits -- definitions #

This module materializes the library's list-level pairing codec from Boolean constants and selected primary inputs. The resulting circuit can feed a fixed serialized query directly into another circuit.

def Complexity.Circuit.pairSourceWidth (leftWidth rightWidth : ) :

Width of pair left right when the two payload widths are fixed.

Equations
Instances For
    instance Complexity.Circuit.instNeZeroNatPairSourceWidth (leftWidth rightWidth : ) :
    NeZero (pairSourceWidth leftWidth rightWidth)
    def Complexity.Circuit.pairSourceList {inputWidth leftWidth rightWidth : } (left : Fin leftWidthInputSource inputWidth) (right : Fin rightWidthInputSource inputWidth) :
    List (InputSource inputWidth)

    Source list for the self-delimiting pair: duplicate the left sources, write the 01 separator, then copy the right sources verbatim.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Complexity.Circuit.pairSources {inputWidth leftWidth rightWidth : } (left : Fin leftWidthInputSource inputWidth) (right : Fin rightWidthInputSource inputWidth) :
      Fin (pairSourceWidth leftWidth rightWidth)InputSource inputWidth

      Fixed-width tuple of input sources spelling one self-delimiting pair.

      Equations
      Instances For
        def Complexity.Circuit.pairInputSources {inputWidth leftWidth rightWidth : } [NeZero inputWidth] (left : Fin leftWidthInputSource inputWidth) (right : Fin rightWidthInputSource inputWidth) :
        Circuit Basis.andOr2 inputWidth (pairSourceWidth leftWidth rightWidth) 0

        Zero-internal-gate circuit materializing one self-delimiting pair.

        Equations
        Instances For