Documentation

DescriptiveComplexity.KromImplication

The implication graph of a Krom program #

A Krom program, instantiated in a structure, is a 2-CNF: its propositional variables are the atoms of the block at tuples of elements (DescriptiveComplexity.KromImpl.KromAtom), and each clause of the program contributes one propositional clause per valuation of its universally quantified variables satisfying its guard (DescriptiveComplexity.KromImpl.clauseRel).

So the criterion of DescriptiveComplexity.TwoCnf applies, and gives the fact this file exists for:

(∃ ρ, prog.Holds ρ) ↔ no goal clause fires ∧ no literal reaches its own negation and back

(DescriptiveComplexity.KromImpl.exists_holds_iff). The first conjunct is the empty clause of the 2-CNF, which has no place in the abstract criterion and is therefore carried separately: a clause of the program with neither literal slot filled is guard → ⊥, and its firing makes the program unsatisfiable outright.

This is the Lean-level half of the converse translation from the Krom fragment to FO(TC): what remains after it is to express the implication graph as a DescriptiveComplexity.TCSpec, i.e. to build the transition formulas that walk it. The half proved here is where the mathematics is; the other half is formula plumbing.

The propositional variables #

A propositional variable of the instantiated program: a relation variable of the block together with a tuple of elements.

Equations
Instances For
    Dependency graph
    Dependency graph

    The block assignment described by a truth assignment of the propositional variables.

    Equations
    Instances For
      Dependency graph

      The truth assignment of the propositional variables described by a block assignment.

      Equations
      Instances For
        Dependency graph
        Dependency graph
        Dependency graph
        theorem DescriptiveComplexity.KromImpl.eq_of_mem_option {α : Type} {o : Option α} {a b : α} (ha : a o) (hb : b o) :
        a = b
        Dependency graph
        def DescriptiveComplexity.KromImpl.atomVar {B : SOBlock} {k : } {A : Type} (a : SOAtom B k) (v : Fin kA) :

        The propositional variable an atom denotes at a valuation.

        Equations
        Instances For
          Dependency graph
          def DescriptiveComplexity.KromImpl.litOf {B : SOBlock} {k : } {A : Type} (l : KromLit B k) (v : Fin kA) :

          The literal a Krom literal denotes at a valuation.

          Equations
          Instances For
            Dependency graph
            theorem DescriptiveComplexity.KromImpl.holds_iff_litTrue {B : SOBlock} {k : } {A : Type} (l : KromLit B k) (ν : KromAtom B AProp) (v : Fin kA) :
            Dependency graph

            The 2-CNF of a program #

            The clauses of the instantiated program, as a 2-CNF in the sense of DescriptiveComplexity.TwoCnf: a clause of the program whose guard holds at some valuation contributes the disjunction of its two literals, read at that valuation. A unit clause contributes the disjunction of its literal with itself, which is what DescriptiveComplexity.TwoCnf expects.

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

              The ordered pairs of literals a clause contributes to the implication graph: the clause ℓ₁ ∨ ℓ₂ gives the edges ¬ℓ₁ → ℓ₂ and ¬ℓ₂ → ℓ₁, and a unit clause the edge ¬ℓ → ℓ. The pair records the two clause literals, the edge running from the negation of the first to the second.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.KromImpl.step_iff_edgePairs {L : FirstOrder.Language} {B : SOBlock} {k : } {A : Type} [L.Structure A] (prog : KromProgram L B k) (p q : TwoCnf.Lit (KromAtom B A)) :
                TwoCnf.Step (clauseRel prog) p q cprog, ∃ (v : Fin kA), c.guard.Realize v predgePairs c, TwoCnf.neg p = litOf pr.1 v q = litOf pr.2 v

                The implication graph, clause by clause: there is an edge from p to q exactly when some clause of the program, at some valuation satisfying its guard, contributes the pair whose first literal is the negation of p and whose second is q. The DescriptiveComplexity.TwoCnf.Step on the left is symmetric in the two literals of a clause, which is why the ordered pairs of DescriptiveComplexity.KromImpl.edgePairs suffice.

                Dependency graph

                Some goal clause of the program fires: a clause with neither literal slot filled whose guard holds. Such a clause is guard → ⊥, so the program is then unsatisfiable, a case the abstract criterion does not cover.

                Equations
                Instances For
                  Dependency graph

                  An assignment satisfies the program iff it satisfies the 2-CNF and no goal clause fires.

                  Dependency graph
                  theorem DescriptiveComplexity.KromImpl.exists_holds_iff {L : FirstOrder.Language} {B : SOBlock} {k : } {A : Type} [L.Structure A] [Finite A] (prog : KromProgram L B k) :
                  (∃ (ρ : B.Assignment A), prog.Holds ρ) ¬GoalFires prog A ∀ (p : TwoCnf.Lit (KromAtom B A)), ¬(TwoCnf.Reach (clauseRel prog) p (TwoCnf.neg p) TwoCnf.Reach (clauseRel prog) (TwoCnf.neg p) p)

                  The criterion for a Krom program: it is satisfiable exactly when no goal clause fires and no literal of its implication graph reaches its own negation and back.

                  Dependency graph