Documentation

Complexitylib.Metacomplexity.BooleanDependency.Encoding.Defs

Canonical encoding of finite Boolean assignments and tables -- definitions #

Coordinates are listed in their linear order. Boolean assignments to k coordinates are then indexed by the corresponding little-endian k-bit vector, giving a computable equivalence with Fin (2^k). This fixes a canonical order for serializing arbitrary Boolean dependency tables.

def Complexity.BooleanDependency.assignmentIndexEquiv {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) :
(coordinatesBool) Fin (2 ^ coordinates.card)

Computable little-endian indexing of all Boolean assignments to an ordered finite coordinate set.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    structure Complexity.BooleanDependency.OrderedAssignment {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) :
    Type u_1

    Boolean assignments equipped with their canonical little-endian order.

    • toFun : coordinatesBool

      Underlying assignment.

    Instances For
      def Complexity.BooleanDependency.OrderedAssignment.indexEquiv {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) :
      OrderedAssignment coordinates Fin (2 ^ coordinates.card)

      Ordered assignments are canonically equivalent to their little-endian indices.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Complexity.BooleanDependency.encodeOrderedFunction {index : Type u_1} [Fintype index] [LinearOrder index] (function : indexBool) :

        Encode a Boolean function on any finite linearly ordered domain.

        Equations
        Instances For
          def Complexity.BooleanDependency.decodeOrderedFunction? {index : Type u_1} [Fintype index] [LinearOrder index] (bits : List Bool) :
          Option (indexBool)

          Decode a Boolean function on a finite linearly ordered domain only from a bit string with exactly one entry per domain element.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Complexity.BooleanDependency.encodeAssignment {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) (assignment : coordinatesBool) :

            Encode one assignment by listing its coordinate values in increasing coordinate order.

            Equations
            Instances For
              def Complexity.BooleanDependency.decodeAssignment? {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) (bits : List Bool) :
              Option (coordinatesBool)

              Decode an assignment only from a bit string of the exact required length.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def Complexity.BooleanDependency.encodeTable {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) (table : (coordinatesBool)Bool) :

                Serialize a Boolean table in the canonical little-endian assignment order.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Complexity.BooleanDependency.decodeTable? {coordinate : Type u_1} [LinearOrder coordinate] (coordinates : Finset coordinate) (bits : List Bool) :
                  Option ((coordinatesBool)Bool)

                  Decode a Boolean table only from a bit string with exactly one entry for every assignment.

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