Documentation

Complexitylib.SAT.Tseitin.Machine.Internal.BufferSpecs

Hoare specifications for Tseitin literal buffers and emitters #

This file gives the register-level contracts used by the streaming-controller induction. A BufferValues packages the values of all six unary registers; BufferValues.work realizes it as the concrete work-tape function. Every contract fixes a parked input tape, preserves the scratch register, and tracks the append-only output word exactly.

Time bounds are explicit structural sums of the already-proved register and emitter bounds. Keeping the composition overhead visible makes these theorems stable under later polynomial rounding.

Main results #

Six-register model #

Values stored in the six fixed work registers of the streaming machine.

  • fresh :

    First unused variable index.

  • current :

    Variable index currently being decoded.

  • a :

    First pending literal's variable index.

  • b :

    Second pending literal's variable index.

  • c :

    Third pending literal's variable index.

  • scratch :

    Temporary register, zero between controller operations.

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

      Realize six values as the concrete fixed-layout unary-register tapes.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem Complexity.SAT.ThreeSAT.Machine.BufferValues.update_fresh (v : BufferValues) (x : ) :
        Function.update v.work freshReg (TM.regTape x) = { fresh := x, current := v.current, a := v.a, b := v.b, c := v.c, scratch := v.scratch }.work
        @[simp]
        theorem Complexity.SAT.ThreeSAT.Machine.BufferValues.update_current (v : BufferValues) (x : ) :
        Function.update v.work currentReg (TM.regTape x) = { fresh := v.fresh, current := x, a := v.a, b := v.b, c := v.c, scratch := v.scratch }.work
        @[simp]
        theorem Complexity.SAT.ThreeSAT.Machine.BufferValues.update_a (v : BufferValues) (x : ) :
        Function.update v.work bufferAReg (TM.regTape x) = { fresh := v.fresh, current := v.current, a := x, b := v.b, c := v.c, scratch := v.scratch }.work
        @[simp]
        theorem Complexity.SAT.ThreeSAT.Machine.BufferValues.update_b (v : BufferValues) (x : ) :
        Function.update v.work bufferBReg (TM.regTape x) = { fresh := v.fresh, current := v.current, a := v.a, b := x, c := v.c, scratch := v.scratch }.work
        @[simp]
        theorem Complexity.SAT.ThreeSAT.Machine.BufferValues.update_c (v : BufferValues) (x : ) :
        Function.update v.work bufferCReg (TM.regTape x) = { fresh := v.fresh, current := v.current, a := v.a, b := v.b, c := x, scratch := v.scratch }.work

        Standard Hoare predicate for a fixed input, six registers, and output accumulator.

        Equations
        Instances For

          Encoded output words and structural time bounds #

          Concrete encoded bits appended by emitLitTM for a literal.

          Equations
          Instances For
            def Complexity.SAT.ThreeSAT.Machine.clauseBits (aSign : Bool) (a : ) (bSign : Bool) (b : ) (cSign : Bool) (c : ) :

            Concrete encoding of one three-literal clause, including its clause separator.

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

              Exact primitive bound for one literal emitter.

              Equations
              Instances For

                Structural bound for three literal emitters and a clause separator.

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

                  Exact bound exposed by copyIntoTM_hoareTime.

                  Equations
                  Instances For

                    Primitive increment/clear bound for a unary register.

                    Equations
                    Instances For

                      Clause emitters #

                      theorem Complexity.SAT.ThreeSAT.Machine.emitClauseTM_hoareTime_internal (aSign bSign cSign : Bool) (aReg bReg cReg : Fin workTapeCount) (a b c : ) (inp : Tape) (work : Fin workTapeCountTape) (ys : List Bool) (hinp : TM.Parked inp) (hwork : ∀ (i : Fin workTapeCount), TM.Parked (work i)) (ha : work aReg = TM.regTape a) (hb : work bReg = TM.regTape b) (hc : work cReg = TM.regTape c) :
                      (emitClauseTM aSign aReg bSign bReg cSign cReg).HoareTime (TM.EmitPred inp work ys) (TM.EmitPred inp work (ys ++ clauseBits aSign a bSign b cSign c)) (clauseTime a b c)

                      Emit exactly one encoded three-literal clause, preserving every tape except for append-only output growth.

                      theorem Complexity.SAT.ThreeSAT.Machine.emitWideLinkTM_hoareTime_internal (aSign bSign : Bool) (v : BufferValues) (inp : Tape) (ys : List Bool) (hinp : TM.Parked inp) :
                      (emitWideLinkTM aSign bSign).HoareTime (BufferPred inp v ys) (BufferPred inp v (ys ++ clauseBits aSign v.a bSign v.b true v.fresh)) (clauseTime v.a v.b v.fresh)

                      Specialized wide-link emitter (a ∨ b ∨ fresh).

                      Pending-clause emission #

                      theorem Complexity.SAT.ThreeSAT.Machine.emitPendingTM_hoareTime_internal (pending : PendingSigns) (v : BufferValues) (inp : Tape) (ys : List Bool) (hinp : TM.Parked inp) :
                      (emitPendingTM pending).HoareTime (BufferPred inp v ys) (BufferPred inp v (ys ++ pendingBits pending v)) (pendingTime pending v)

                      Emit the exact-3 gadget selected by PendingSigns, leaving all registers unchanged.

                      Buffer clearing #

                      Register values after clearing the current literal and three buffers.

                      Equations
                      Instances For

                        Structural time bound for clearBuffersTM.

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

                          Clear all literal registers, preserving fresh/scratch and output.

                          Wide-window rotation #

                          Register values after rotating (a,b,c,current,fresh) to (fresh,c,current,0,fresh+1).

                          Equations
                          Instances For

                            Structural time bound for rollWideBuffersTM.

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

                              Rotate the three pending buffers after emitting a wide link.

                              Literal commit #

                              Register values after committing currentReg under a pending shape.

                              Equations
                              Instances For

                                Bits emitted while committing a literal. Only the fourth-and-later case emits a completed wide link.

                                Equations
                                Instances For

                                  Structural time bound for commitLiteralTM.

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

                                    Commit the current decoded literal: buffer it when fewer than three are pending, or emit and roll a wide link otherwise.

                                    Clause close #

                                    Fresh-register value after the empty-clause advance phase.

                                    Equations
                                    Instances For

                                      Structural time bound for closing a clause.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Complexity.SAT.ThreeSAT.Machine.closeClauseTM_hoareTime_internal (pending : PendingSigns) (v : BufferValues) (inp : Tape) (ys : List Bool) (hinp : TM.Parked inp) :
                                        (closeClauseTM pending).HoareTime (BufferPred inp v ys) (BufferPred inp (BufferValues.closed pending v) (ys ++ pendingBits pending v)) (closeClauseTime pending v)

                                        Emit the pending clause, perform the empty-clause fresh increment when needed, and reset all literal buffers.