Documentation

DescriptiveComplexity.Problems.ThreeSat.CountingFromSat

#SAT reduces parsimoniously to #3SAT #

The clause-splitting reduction of DescriptiveComplexity.Problems.ThreeSat.FromSat threads fresh variables along the occurrences of a clause, and leaves them free once the clause is satisfied; it preserves satisfiability, not the number of models. This file is the variant that preserves it, DescriptiveComplexity.sharpSat_ordered_parsimonious_sharpThreeSat, which makes #3SAT parsimoniously #P-complete (DescriptiveComplexity.sharpThreeSat_sharpP_parsimoniousComplete).

For each occurrence (x, s) of a clause c, the interpretation (DescriptiveComplexity.SharpSatToThreeSat.interp, dimension 2) has a variable z = (.pre s, (c, x)), forced to be the truth of the disjunction of the occurrences of c up to (x, s) by three clauses, with z' the variable of the preceding occurrence when there is one:

and the last occurrence of c carries the unit clause (.top s, (c, x)): z. Empty clauses are copied as empty clauses. That such z are determined by the assignment, and exist exactly when it satisfies every clause, is the interpretation-free content of DescriptiveComplexity.OccurrencePrefix.

Tags of the parsimonious clause-splitting interpretation.

  • var : PTag

    (.var, (x, x)) is the copy of the propositional variable x.

  • pre (s : Bool) : PTag

    (.pre s, (c, x)) is the prefix variable of the occurrence (x, s) of the clause c.

  • k0 (s : Bool) : PTag

    The clause ¬z ∨ ℓ ∨ z' of an occurrence.

  • k1 (s : Bool) : PTag

    The clause z ∨ ¬ℓ of an occurrence.

  • k2 (s : Bool) : PTag

    The clause z ∨ ¬z' of an occurrence that has a predecessor.

  • top (s : Bool) : PTag

    The unit clause z of the last occurrence of a clause.

  • empty : PTag

    (.empty, (c, c)) is the copy of the empty clause c.

Instances For
    Dependency graph
    Equations
    Instances For
      Dependency graph
      Dependency graph
      Dependency graph
      Dependency graph
      Dependency graph
      Dependency graph

      The second argument sits on the occurrence (y, t) of the same clause immediately preceding the occurrence (x, s) of the first.

      Equations
      Instances For
        Dependency graph
        Dependency graph

        Defining formula for satPosIn.

        Equations
        Instances For
          Dependency graph

          Defining formula for satNegIn.

          Equations
          Instances For
            Dependency graph

            The parsimonious clause-splitting interpretation.

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

              Characterization of the interpreted relations #

              The second pair is the diagonal on the variable of the first.

              Equations
              Instances For
                Dependency graph

                The two pairs are the same.

                Equations
                Instances For
                  Dependency graph

                  Assignments of the split, read as prefix valuations #

                  theorem DescriptiveComplexity.SharpSatToThreeSat.eta2 {A : Type} (w : Fin 2 → A) :
                  ![w 0, w 1] = w
                  Dependency graph
                  theorem DescriptiveComplexity.SharpSatToThreeSat.ownVar_eq {A : Type} {w₁ w₂ : Fin 2 → A} (h : OwnVar w₁ w₂) :
                  w₂ = fun (x : Fin 2) => w₁ 1
                  Dependency graph
                  theorem DescriptiveComplexity.SharpSatToThreeSat.same_eq {A : Type} {w₁ w₂ : Fin 2 → A} (h : Same w₁ w₂) :
                  w₂ = w₁
                  Dependency graph

                  The assignment read on the variable copies.

                  Equations
                  Instances For
                    Dependency graph

                    The assignment read on the prefix variables.

                    Equations
                    Instances For
                      Dependency graph

                      The clause K contains a literal made true by ν'.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        theorem DescriptiveComplexity.SharpSatToThreeSat.val_congr {A : Type} {ν' : interp.Map A → Prop} (t : PTag) {u u' : Fin 2 → A} (h : u = u') :
                        ν' (t, u) ↔ ν' (t, u')
                        Dependency graph

                        Every clause of the split has a true literal exactly when the assignment is a prefix valuation, read on the variable copies and the prefix variables.

                        Dependency graph

                        The variables of the split #

                        Dependency graph

                        Models of the split are models of the input #

                        The assignment of the split determined by an assignment of the input, before its restriction to the variables of the split: variable copies follow it, and a prefix variable is the truth of its prefix disjunction.

                        Equations
                        Instances For
                          Dependency graph
                          Dependency graph

                          The models of the split are the models of the input, bijectively: a model of the input extends by the truth of its prefix disjunctions, and a model of the split is recovered from its variable copies because the prefix variables are determined.

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

                            The width bound #

                            A code for the literals of a clause, in three values: the variable copy, the prefix variable occurring positively, the one occurring negatively.

                            Equations
                            Instances For
                              Dependency graph
                              Dependency graph

                              Correctness of the interpretation, for counting: the split has as many models as the input.

                              Dependency graph

                              #SAT reduces parsimoniously to #3SAT: the clause-splitting interpretation with determined prefix variables preserves the number of models.

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

                                SharpThreeSAT is #P-complete: parsimoniously, hence under subtractive reductions.

                                Dependency graph