Documentation

Complexity.Logics.Propositional.ClauseSet.Sparsification.List

Sparsification on formulas #

The branching step of the sparsification procedure on formulas in conjunctive normal form, as list operations: reduction (CNF.Sparsification.reduce), flowers and petals, the children (CNF.Sparsification.child) and a computed heavy-heart choice (CNF.Sparsification.choice).

Formulas are kept in a normal form (CNF.Sparsification.Normalized): no clause repeats a literal or has more than k literals, no two clauses have the same literals, and no clause strictly contains another. Then a formula and its clause set have the same number of clauses, and the list operations compute the clause-set operations of Cslib.Logic.PL.ClauseSet.Sparsification (CNF.Sparsification.toClauseSet_child). Any formula of width k is brought into normal form by CNF.Sparsification.normalize.

The candidate hearts of a clause C are its sublists selected by the subsets of the first k positions (CNF.Sparsification.hearts); for clauses of width k these are all of its subclauses, so every heavy heart is a candidate. The choice takes a heavy candidate of least rank c (k + 1) + (k - |H|), which has the smallest clause size c and then the largest heart: a valid choice (CNF.Sparsification.choice_spec). So the list-level step is a branching rule (CNF.Sparsification.rule) on the formulas in normal form, to which the analysis of the branching tree applies.

Main definitions #

Main results #

References #

The list operations #

Whether every literal of D is a literal of C.

Instances For

    Remove every clause whose literals strictly contain those of another clause.

    Instances For
      def Cslib.Logic.PL.CNF.Sparsification.flower {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) :
      CNF V

      The flower of H at clause size c: the clauses of length c containing the literals of H.

      Instances For
        def Cslib.Logic.PL.CNF.Sparsification.petals {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) :
        CNF V

        The petals C \ H of the flower of H.

        Instances For
          def Cslib.Logic.PL.CNF.Sparsification.intro {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) (b : Bool) :
          CNF V

          The clauses a branch introduces: the heart (false) or the petals (true).

          Instances For
            def Cslib.Logic.PL.CNF.Sparsification.child {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) (b : Bool) :
            CNF V

            A child of a branching node: add the introduced clauses and reduce.

            Instances For
              def Cslib.Logic.PL.CNF.Sparsification.heavy {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (ψ : CNF V) (x : ℕ × Clause V) :

              Whether H is a heavy heart for clause size c, for the thresholds θ.

              Instances For

                The candidate hearts of a clause: its sublists selected by subsets of the first k positions.

                Instances For

                  The candidate pairs of a clause size and a heart: each clause with its candidate hearts.

                  Instances For

                    The rank c (k + 1) + (k - |H|) of a clause size c and a heart H: smaller sizes, and then larger hearts, have smaller ranks.

                    Instances For
                      def Cslib.Logic.PL.CNF.Sparsification.choice {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (k : ℕ) (ψ : CNF V) :

                      The computed choice: a heavy candidate of least rank, or (0, []) if there is none.

                      Instances For
                        def Cslib.Logic.PL.CNF.Sparsification.isSparse {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (k : ℕ) (ψ : CNF V) :

                        Whether no candidate is a heavy heart.

                        Instances For
                          def Cslib.Logic.PL.CNF.Sparsification.next {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (k : ℕ) (ψ : CNF V) (b : Bool) :
                          CNF V

                          One branching step: the heart (false) or petal (true) child for the computed choice.

                          Instances For

                            Remove repeated literals of a clause, keeping first occurrences.

                            Instances For

                              Remove every clause with the same literals as an earlier clause.

                              Instances For

                                The normal form of a formula: repeated literals and clauses removed, and reduced.

                                Instances For

                                  Clause sets of formulas #

                                  theorem Cslib.Logic.PL.CNF.Sparsification.toClauseSet_child {V : Type u_1} [DecidableEq V] {ψ : CNF V} (hnd : ∀ C ∈ ψ, List.Nodup C) (c : ℕ) (H : Clause V) (b : Bool) :

                                  The list-level children compute the clause-set children.

                                  The normal form #

                                  The normal form of the list-level procedure, for width k: no clause repeats a literal or has more than k literals, no two clauses have the same literals, and no clause strictly contains another.

                                  Instances For

                                    A formula in normal form has as many clauses as its clause set.

                                    theorem Cslib.Logic.PL.CNF.Sparsification.Normalized.card_le {V : Type u_1} [DecidableEq V] {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) (C : Finset (Literal V)) :
                                    C ∈ ψ.toClauseSet → C.card ≤ k

                                    Candidates #

                                    theorem Cslib.Logic.PL.CNF.Sparsification.choice_spec {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) (hns : ¬ClauseSet.Sparsification.Sparse θ ψ.toClauseSet) :

                                    The computed choice is valid. At a formula in normal form that is not sparse, the computed choice is a heavy heart with the smallest clause size, and among those the largest heart.

                                    theorem Cslib.Logic.PL.CNF.Sparsification.isSparse_eq_true_iff {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) :

                                    The list-level test decides sparseness of formulas in normal form.

                                    The step preserves the normal form #

                                    theorem Cslib.Logic.PL.CNF.Sparsification.toClauseSet_next {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) (b : Bool) :
                                    theorem Cslib.Logic.PL.CNF.Sparsification.normalized_next {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) (hns : ¬ClauseSet.Sparsification.Sparse θ ψ.toClauseSet) (b : Bool) :
                                    Normalized k (next θ k ψ b)

                                    The branching rule #

                                    def Cslib.Logic.PL.CNF.Sparsification.rule {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) (k : ℕ) :

                                    The list-level branching rule, on formulas in normal form: the computed choice, and at a sparse formula no step.

                                    Instances For

                                      Normalization #

                                      theorem Cslib.Logic.PL.CNF.Sparsification.normalized_normalize {V : Type u_1} [DecidableEq V] {k : ℕ} {φ : CNF V} (hφ : ∀ C ∈ φ, List.length C ≤ k) :

                                      Normalization. Every formula of width k has a normal form with the same solutions.