Documentation

DescriptiveComplexity.Problems.TwoSat.Implication

The implication graph of a width-two CNF #

The criterion for 2-satisfiability (Aspvall, Plass & Tarjan 1979) in the form the PTIME membership of 2SAT needs: a width-two CNF with no empty clause is satisfiable iff no variable reaches its own negation and back in the implication graph.

The criterion itself is proved once and for all, without any logic, in DescriptiveComplexity.TwoCnf: it is about an arbitrary 2-CNF, given as a relation on literals over a finite type of variables. This file is its instance for CNF structures: the variables are the elements of the universe, and the clauses are the pairs of occurrences that cover a clause of the structure (DescriptiveComplexity.TwoSatImpl.clauseRel, using DescriptiveComplexity.exists_covering_pair for the width promise). A clause covered by (x, s) and (y, u) is the disjunction ℓ(x, s) ∨ ℓ(y, u), hence the two implications ¬ℓ(x, s) → ℓ(y, u) and ¬ℓ(y, u) → ℓ(x, s); a unit clause is the case (y, u) = (x, s), whose implication ¬ℓ(x, s) → ℓ(x, s) forces the literal, so it needs no separate treatment.

What the instance has to supply is the dictionary in both directions between satisfying the structure (some occurrence of every clause is true) and satisfying the abstract 2-CNF (some literal of every clause is true), which is where the width promise and the absence of an empty clause are used.

The implication graph of a CNF structure #

The clause c is covered by the two signed occurrences (x, s) and (y, u): both occur in it, and nothing else does.

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

    One step of the implication graph: a clause covered by (x, s) and (y, u) implies ¬ℓ(x, s) → ℓ(y, u) and ¬ℓ(y, u) → ℓ(x, s).

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

      Reading the structure as an abstract 2-CNF #

      The structure read as a 2-CNF in the sense of DescriptiveComplexity.TwoCnf: the variables are the elements, and p ∨ q is a clause when some clause of the structure is covered by the occurrences p and q.

      Equations
      Instances For
        Dependency graph
        Dependency graph
        Dependency graph

        A satisfying assignment of the structure satisfies the abstract 2-CNF.

        Dependency graph

        Conversely, an assignment satisfying the abstract 2-CNF satisfies the structure – provided the width promise holds and no clause is empty, which is what makes every clause the disjunction of a covering pair.

        Dependency graph

        The criterion, for CNF structures #

        No satisfiable instance has a bad cycle: a variable reaching its own negation and back would be both true and false.

        Dependency graph

        The criterion for 2-satisfiability: a width-two CNF with no empty clause and no variable reaching its own negation and back is satisfiable. This is DescriptiveComplexity.TwoCnf.exists_satisfies_of_no_bad_cycle read through the dictionary above.

        Dependency graph