Documentation

DescriptiveComplexity.ClauseDischarge

Shared scaffolding of the clausal discharges #

The clausal fragments of existential second-order logic – SO-Horn (DescriptiveComplexity.SecondOrderHorn) and SO-Krom (DescriptiveComplexity.SecondOrderKrom) – have discharges of the same shape: a program is translated, inside an ordered input structure, into a CNF instance whose propositional variables are the second-order atoms and whose clauses are the instances of the program's clauses whose guard holds (DescriptiveComplexity.Problems.HornSat.Hardness, DescriptiveComplexity.Problems.TwoSat.Hardness). Only the literals differ: a head and a body list on the Horn side, two signed slots on the Krom side.

Everything that does not depend on that difference is here:

Dimension and tags #

noncomputable def DescriptiveComplexity.clauseDim (B : SOBlock) (k : ) :

The dimension of a clausal discharge: large enough for the k universally quantified first-order variables of the program and for every argument tuple of a relation variable of the block.

Equations
Instances For
    Dependency graph
    Dependency graph
    Dependency graph
    @[reducible, inline]

    The tags of a clausal discharge of a program with m clauses: one per clause, one per relation variable of the block, plus a junk tag keeping the tag type nonempty when the program has no clause and the block no variable (its elements are neither clauses nor literals).

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]
      abbrev DescriptiveComplexity.clTag {m : } {B : SOBlock} (c : Fin m) :

      The tag of the clauses coming from the c-th clause of the program.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]
        abbrev DescriptiveComplexity.varTag {m : } {B : SOBlock} (i : B.ι) :

        The tag of the propositional variables standing for the atoms of the relation variable i.

        Equations
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.atomIdx {B : SOBlock} {k : } (a : SOAtom B k) :
          Fin (B.arity a.idx)Fin (clauseDim B k)

          The arguments of a second-order atom, as coordinates of the clause tuple.

          Equations
          Instances For
            Dependency graph

            The two defining formulas #

            noncomputable def DescriptiveComplexity.guardF {L : FirstOrder.Language} {B : SOBlock} {k : } {γ : Type} (φ : (L.sum FirstOrder.Language.order).Formula (Fin k)) (u : Fin (clauseDim B k)γ) :

            The guard of a clause, reading its variables off the coordinates selected by u.

            Equations
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.atomOccF {L : FirstOrder.Language} {B : SOBlock} {k : } {γ : Type} (a : SOAtom B k) (u x : Fin (clauseDim B k)γ) :

              The occurrence formula of a second-order atom: the coordinates selected by x hold the canonically padded tuple of the atom's arguments, read off the coordinates selected by u.

              Equations
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.realize_guardF {L : FirstOrder.Language} {B : SOBlock} {k : } {γ A : Type} [L.Structure A] [LinearOrder A] {v : γA} {φ : (L.sum FirstOrder.Language.order).Formula (Fin k)} {u : Fin (clauseDim B k)γ} :
                (guardF φ u).Realize v φ.Realize fun (j : Fin k) => v (u (Fin.castLE j))
                Dependency graph
                theorem DescriptiveComplexity.realize_atomOccF {L : FirstOrder.Language} {B : SOBlock} {k : } {γ A : Type} [L.Structure A] [LinearOrder A] {v : γA} {a : SOAtom B k} {u x : Fin (clauseDim B k)γ} :
                (atomOccF a u x).Realize v PadTup (atomIdx a) (fun (j : Fin (clauseDim B k)) => v (u j)) fun (j : Fin (clauseDim B k)) => v (x j)
                Dependency graph