Documentation

DescriptiveComplexity.Problems.Machine.QsatTape

The tape of the QBF machine #

The layout half of QSAT ≤ᶠᵒ[≤] DTMAcceptSpace: which tagged tuples are positions, in what order they sit, and what the tape holds to begin with. The program that runs on this tape – states, symbols, transitions – is separate.

The layout #

One cell per quantified variable, bracketed by two markers:

  ⊢   v₁ v₂ … vₙ   ⊣

There are no filler cells: DescriptiveComplexity.TMData.AcceptsSpace has no step bound, so unlike the tape of DescriptiveComplexity.Problems.Machine.Tape this one needs to supply space only, and the space it must supply is one bit of value and one bit of “both values already tried” per variable – the stack of the recursive evaluation of a quantified Boolean formula, held in the variables' own cells.

The order is the quantifier prefix #

The head walks the variables in the order the quantifiers bind them, so the tape order cannot be the ambient one. DescriptiveComplexity.QsatTM.PLe puts the quantified variables first, in prefix order, and everything else after them in the ambient order; it is a linear order on the universe exactly when the instance is well formed (DescriptiveComplexity.QsatWf), and DescriptiveComplexity.QsatTM.QLe is the lexicographic order built from it – tag index first, then the two coordinates.

Malformed instances are not handled by the order: they are handled by a guard on the accepting predicate, in the program file. QsatWf is first-order, and DescriptiveComplexity.QsatHolds requires it, so an instance violating it must map to a machine that cannot accept – which a guard achieves and a broken order would not (an instance whose prefix order relates a non-variable still has a linear PLe).

The tags #

The tags of the QBF machine. Positions come first, so that the tape order is the order of their indices; symbols, states and transitions follow.

  • pStart : QTag

    The left marker cell.

  • pCell : QTag

    The cell of a quantified variable.

  • pEnd : QTag

    The right marker cell.

  • sStart : QTag

    The left-marker symbol .

  • sEnd : QTag

    The right-marker symbol .

  • sBlank : QTag

    The blank symbol.

  • sVal (b f : Bool) : QTag

    The symbol of a variable's cell: value b, and f recording that both values have already been tried.

  • qDesc : QTag

    Descending into the subtree: initialise the cells to the right.

  • qEval (f d : Bool) : QTag

    Evaluating the matrix: the clause is carried by the state, f is the accumulated flag and d the sweep direction (true = rightwards).

  • qToEnd (b : Bool) : QTag

    Carrying the value b back to the right marker.

  • qProc (b : Bool) : QTag

    Returning the value b through the quantifier prefix.

  • qAcc : QTag

    The accepting state, a sink.

  • tDescStart : QTag

    Descend: step over the left marker.

  • tDescCell (b f : Bool) : QTag

    Descend: initialise a variable's cell, reading (b, f).

  • tDescEndTrue : QTag

    Descend over, and the matrix has no clause: it is true.

  • tDescEndEval : QTag

    Descend over: start evaluating the lowest clause.

  • tEval (b f fl d : Bool) : QTag

    Evaluate: read (b, f) at a cell, with flag fl, sweeping in direction d.

  • tTurnNext (d : Bool) : QTag

    Evaluate: the clause is satisfied and another one follows.

  • tTurnLast (d : Bool) : QTag

    Evaluate: the clause is satisfied and it was the last one.

  • tTurnFalse (d : Bool) : QTag

    Evaluate: the clause is not satisfied, so the matrix is false.

  • tToEndCell (v b f : Bool) : QTag

    Carry: step over a variable's cell, reading (b, f).

  • tToEndStart (v : Bool) : QTag

    Carry: step over the left marker.

  • tToEndTurn (v : Bool) : QTag

    Carry: the right marker is reached, turn round and return.

  • tProcSkip (v b f : Bool) : QTag

    Return: this level is decided, pass the value on.

  • tProcSwitch (v b f : Bool) : QTag

    Return: this level must try its second value.

  • tProcAcc : QTag

    Return: the prefix is exhausted and the value is true.

Instances For
    Dependency graph
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph
      Dependency graph
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      Dependency graph
      Dependency graph

      The index of a tag: the tape order on the position tags, and an arbitrary injective numbering of the rest.

      Equations
      Instances For
        Dependency graph
        Dependency graph

        The prefix order, as an order on the universe #

        The quantified variables come first, in the order the prefix binds them; every other element comes after, in the ambient order.

        The tape order on elements: quantified variables first in prefix order, the rest afterwards in the ambient order.

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

          The tape order is a linear order on a well-formed instance.

          Dependency graph

          The order on the universe #

          @[reducible, inline]

          The universe of the QBF machine: tagged pairs.

          Equations
          Instances For
            Dependency graph

            The tape order on tuples: lexicographic in DescriptiveComplexity.QsatTM.PLe.

            Equations
            Instances For
              Dependency graph

              The tape order: tag index first, then the tuple lexicographically.

              Equations
              Instances For
                Dependency graph

                The tape order is linear on a well-formed instance.

                Dependency graph

                Positions, blank and the initial tape #

                The tagged tuples that are positions: the two markers, pinned to the tuple of ambient minima, and one cell per quantified variable.

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

                  The blank symbol, pinned to the tuple of ambient minima. It is never read: every cell of the initial tape carries a symbol.

                  Equations
                  Instances For
                    Dependency graph
                    Dependency graph
                    theorem DescriptiveComplexity.QsatTM.qBlank_unique {A : Type} [LinearOrder A] {p q : QV A} (hp : QBlank p) (hq : QBlank q) :
                    p = q
                    Dependency graph
                    Dependency graph

                    The initial tape: the markers hold their own symbols, and a variable's cell holds the value false with the flag down.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      theorem DescriptiveComplexity.QsatTM.qInp_functional {A : Type} [LinearOrder A] {p a b : QV A} (ha : QInp p a) (hb : QInp p b) :
                      a = b

                      The initial tape is functional: a cell holds at most one symbol.

                      Dependency graph