Documentation

Complexity.Logics.Propositional.CNF.ExactOne

Exact-one semantics for clauses #

Clause.evalOne counts true literal occurrences, including repeated occurrences of the same variable. CNF.evalOne requires exactly one true literal in every clause. This reuses the existing signed CNF representation; positivity and clause-size restrictions are separate.

CNF.oneEncoding expresses these semantics with ordinary CNF clauses and no new variables. Unlike CNF.exactlyOne, which constrains distinct variables, this encoding counts positions.

Main definitions #

Main results #

References #

def Cslib.Logic.PL.Clause.evalOne {V : Type u_1} (σ : V → Bool) (c : Clause V) :

Exactly one literal occurrence of the clause is true.

Instances For
    def Cslib.Logic.PL.CNF.evalOne {V : Type u_1} (σ : V → Bool) (φ : CNF V) :

    Every clause has exactly one true literal occurrence.

    Instances For

      Some assignment gives exactly one true literal occurrence in every clause.

      Instances For
        @[simp]
        theorem Cslib.Logic.PL.Clause.evalOne_nil {V : Type u_1} (σ : V → Bool) :

        The empty clause cannot have exactly one true literal.

        @[simp]
        theorem Cslib.Logic.PL.Clause.evalOne_singleton {V : Type u_1} (σ : V → Bool) (l : Literal V) :

        A singleton exact-one clause has the same semantics as its literal.

        theorem Cslib.Logic.PL.Clause.evalOne_eq_true_iff {V : Type u_1} (σ : V → Bool) (c : Clause V) :

        Exact-one satisfaction is the occurrence-count equation.

        theorem Cslib.Logic.PL.CNF.evalOne_eq_true_iff {V : Type u_1} (σ : V → Bool) (φ : CNF V) :
        evalOne σ φ = true ↔ ∀ (c : Clause V), c ∈ φ → Clause.evalOne σ c = true

        An assignment satisfies the exact-one formula when it satisfies every exact-one clause.

        @[simp]
        theorem Cslib.Logic.PL.CNF.evalOne_nil {V : Type u_1} (σ : V → Bool) :

        The empty exact-one formula is true.

        @[simp]
        theorem Cslib.Logic.PL.CNF.evalOne_cons {V : Type u_1} (σ : V → Bool) (c : Clause V) (φ : CNF V) :
        evalOne σ (c :: φ) = (Clause.evalOne σ c && evalOne σ φ)

        A cons of exact-one clauses evaluates conjunctively.

        @[simp]
        theorem Cslib.Logic.PL.CNF.evalOne_append {V : Type u_1} (σ : V → Bool) (φ ψ : CNF V) :
        evalOne σ (φ ++ ψ) = (evalOne σ φ && evalOne σ ψ)

        Appending exact-one formulas conjoins their values.

        theorem Cslib.Logic.PL.CNF.evalOne_flatMap_eq_true_iff {V : Type u_1} {ι : Type u_3} (σ : V → Bool) (l : List ι) (f : ι → CNF V) :
        evalOne σ (List.flatMap f l) = true ↔ ∀ (i : ι), i ∈ l → evalOne σ (f i) = true

        A blockwise exact-one formula holds when every block does.

        theorem Cslib.Logic.PL.Clause.evalOne_congr {V : Type u_1} {σ τ : V → Bool} {c : Clause V} (h : ∀ (l : Literal V), l ∈ c → σ l.fst = τ l.fst) :
        evalOne σ c = evalOne τ c

        Clause exact-one evaluation depends only on the variables occurring in it.

        theorem Cslib.Logic.PL.CNF.evalOne_congr {V : Type u_1} {σ τ : V → Bool} {φ : CNF V} (h : ∀ (v : V), v ∈ φ.vars → σ v = τ v) :
        evalOne σ φ = evalOne τ φ

        Formula exact-one evaluation depends only on its variables.

        @[simp]
        theorem Cslib.Logic.PL.Clause.evalOne_relabel {V : Type u_1} {W : Type u_2} (f : V → W) (σ : W → Bool) (c : Clause V) :
        evalOne σ (relabel f c) = evalOne (σ ∘ f) c

        Exact-one clause evaluation commutes with relabelling.

        @[simp]
        theorem Cslib.Logic.PL.CNF.evalOne_relabel {V : Type u_1} {W : Type u_2} (f : V → W) (σ : W → Bool) (φ : CNF V) :
        evalOne σ (relabel f φ) = evalOne (σ ∘ f) φ

        Exact-one formula evaluation commutes with relabelling.

        Clauses forbidding simultaneous truth of each pair of literal positions.

        Instances For

          Express exact-one clause semantics with ordinary clauses and no new variables.

          Instances For
            def Cslib.Logic.PL.CNF.oneEncoding {V : Type u_1} (φ : CNF V) :
            CNF V

            Express exact-one formula semantics with ordinary clauses and no new variables.

            Instances For

              The pair clauses constrain the true occurrence count to be at most one.

              @[simp]
              theorem Cslib.Logic.PL.Clause.eval_oneEncoding {V : Type u_1} (σ : V → Bool) (c : Clause V) :

              Exact-one clause encoding preserves evaluation under the same assignment.

              @[simp]
              theorem Cslib.Logic.PL.CNF.eval_oneEncoding {V : Type u_1} (σ : V → Bool) (φ : CNF V) :

              Exact-one formula encoding preserves evaluation under the same assignment.

              The ordinary encoding is satisfiable exactly when the exact-one source is.

              theorem Cslib.Logic.PL.Clause.fst_mem_of_mem_atMostOneOccurrences {V : Type u_1} {c d : Clause V} (hd : d ∈ c.atMostOneOccurrences) {l : Literal V} (hl : l ∈ d) :
              ∃ (k : Literal V), k ∈ c ∧ l.fst = k.fst

              A variable in a pair clause already occurs in the source clause.

              theorem Cslib.Logic.PL.CNF.mem_vars_oneEncoding {V : Type u_1} {φ : CNF V} {v : V} :

              The encoding has exactly the variables of the source, irrespective of repetitions.

              The pair encoding commutes with renaming variables.

              theorem Cslib.Logic.PL.Clause.oneEncoding_relabel {V : Type u_1} {W : Type u_2} (f : V → W) (c : Clause V) :

              The clause encoding commutes with renaming variables.

              theorem Cslib.Logic.PL.CNF.oneEncoding_relabel {V : Type u_1} {W : Type u_2} (f : V → W) (φ : CNF V) :

              The formula encoding commutes with renaming variables.