Documentation

Complexitylib.Circuits.FormulaEncoding.Defs

Machine-facing encoding of Boolean formulas #

This file defines a canonical postfix encoding of BoolFormula. Six three-bit tags represent variables, constants, and connectives. A variable tag is followed by the existing terminated-unary natural code. The complete stream starts with its terminated-unary token count.

Postfix order makes decoding iterative: the parser first reads a flat token stream, then a stack machine reconstructs the formula. This avoids a recursive on-tape tree parser and gives the later Barrington generator a simple, self-delimiting input language.

Proof-free postfix tokens for Boolean formulas.

  • var (index : ) : Token

    A variable with its natural-number index.

  • tru : Token

    The constant true.

  • fls : Token

    The constant false.

  • neg : Token

    Unary negation.

  • conj : Token

    Binary conjunction.

  • disj : Token

    Binary disjunction.

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

        The exact number of bits in a token encoding.

        Equations
        Instances For

          Execute a postfix token stream from an initial formula stack.

          Equations
          Instances For

            Reconstruct exactly one formula from a postfix token stream.

            Equations
            Instances For

              Decode exactly count token prefixes and return the unused bit suffix.

              Equations
              Instances For

                Canonically encode a Boolean formula.

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

                  Decode one complete formula prefix and return the unused suffix.

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

                    Decode exactly one formula. Trailing bits are rejected.

                    Equations
                    Instances For