Documentation

DescriptiveComplexity.Problems.TwoSat.Membership

2SAT is SO-Krom definable, hence in NL #

The membership half of the completeness of 2SAT for DescriptiveComplexity.NL: a Krom program (DescriptiveComplexity.TwoSatKrom.twoSatProgram) whose satisfying assignments are exactly the satisfying truth assignments of a width-two CNF structure, so DescriptiveComplexity.twoSat_mem_NL.

The program is the natural one, and it shows what the guards of the Krom fragment buy. Guess the truth assignment as the single unary relation variable of DescriptiveComplexity.satAssignBlock, universally quantify three first-order variables c, x, y, and emit:

Correctness rests on DescriptiveComplexity.exists_covering_pair: under the width bound, a clause with an occurrence has two signed occurrences covering all of them, which is exactly the shape a single 2-clause can speak about.

The atoms and the guards #

The atom "the guessed truth assignment holds of the p-th universally quantified variable".

Equations
Instances For
    Dependency graph

    The literal of the occurrence with sign s at the p-th variable: the truth assignment must make it true.

    Equations
    Instances For
      Dependency graph

      The covering condition, as a formula over the ordered expansion: every occurrence of the clause 0 is the occurrence (1, s) or the occurrence (2, u).

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

        The guard of the two-literal clause of the program: 0 is a clause whose occurrences are exactly (1, s) and (2, u).

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

          Realization of the guards #

          theorem DescriptiveComplexity.TwoSatKrom.realize_coverF {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {v : Fin 3A} {s u : Bool} :
          (coverF s u).Realize v ∀ (z : A) (t : Bool), SatOcc.OccIn (v 0) z tz = v 1 t = s z = v 2 t = u
          Dependency graph
          theorem DescriptiveComplexity.TwoSatKrom.realize_pairGuard {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {v : Fin 3A} {s u : Bool} :
          (pairGuard s u).Realize v SatOcc.IsCl (v 0) SatOcc.OccIn (v 0) (v 1) s SatOcc.OccIn (v 0) (v 2) u ∀ (z : A) (t : Bool), SatOcc.OccIn (v 0) z tz = v 1 t = s z = v 2 t = u
          Dependency graph

          The program #

          The two-literal clause of the program, for a pair of signs.

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

            The goal clause firing on an empty clause of the input.

            Equations
            Instances For
              Dependency graph

              The goal clause firing when the width promise of 2SAT is violated.

              Equations
              Instances For
                Dependency graph

                The Krom program defining 2SAT: one two-literal clause per pair of signs, plus the two goal clauses for the empty clause and for the width promise.

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

                  Assignments on both sides #

                  The block assignment induced by a truth assignment.

                  Equations
                  Instances For
                    Dependency graph

                    The truth assignment induced by a block assignment.

                    Equations
                    Instances For
                      Dependency graph
                      theorem DescriptiveComplexity.TwoSatKrom.nuLit_holds_ofTruth {A : Type} (ν : AProp) (p : Fin 3) (s : Bool) (v : Fin 3A) :
                      (nuLit p s).Holds (ofTruth ν) v SatOcc.LitTrue ν (v p) s
                      Dependency graph
                      theorem DescriptiveComplexity.TwoSatKrom.nuLit_holds_toTruth {A : Type} (ρ : satAssignBlock.Assignment A) (p : Fin 3) (s : Bool) (v : Fin 3A) :
                      (nuLit p s).Holds ρ v SatOcc.LitTrue (toTruth ρ) (v p) s
                      Dependency graph

                      The program holds of a satisfying truth assignment #

                      theorem DescriptiveComplexity.TwoSatKrom.pairClause_holds {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {ν : AProp} ( : ∀ (c : A), SatOcc.IsCl c∃ (x : A) (s : Bool), SatOcc.OccIn c x s SatOcc.LitTrue ν x s) (s u : Bool) (v : Fin 3A) :
                      (pairClause s u).Holds (ofTruth ν) v

                      A two-literal clause holds: the input clause has a true occurrence, and the guard says that every occurrence of it is one of the clause's two literals.

                      Dependency graph
                      theorem DescriptiveComplexity.TwoSatKrom.emptyClause_holds {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {ν : AProp} ( : ∀ (c : A), SatOcc.IsCl c∃ (x : A) (s : Bool), SatOcc.OccIn c x s SatOcc.LitTrue ν x s) (v : Fin 3A) :

                      The empty-clause goal clause holds: a satisfied structure has no empty clause, so its guard is false.

                      Dependency graph

                      The width goal clause holds: under the promise, its guard is false.

                      Dependency graph

                      2SAT is SO-Krom definable #

                      2SAT is SO-Krom definable: guess the truth assignment, and let the guards do the rest – one 2-clause per clause of the input (read through a covering pair of occurrences), one goal clause for empty clauses and one for a violated width promise. Since NL is defined as SO-Krom definability, this is the statement TwoSAT ∈ NL.

                      Dependency graph
                      Dependency graph