Documentation

CslibFrontier.Logics.Propositional.CNF.Compact

Compact variable numbering for CNF formulas #

Variables are renamed by their first positions in the list of literal occurrences. The resulting indices are smaller than the number of occurrences, even when the original names have a succinct encoding. Repeated variables retain the same name. This prepares reductions whose output indices are unary without expanding binary input names into unary integers.

Main definitions #

Main results #

References #

Rename each variable by its first position among all literal occurrences.

Instances For
    @[simp]

    Compaction keeps all clauses, their order, and their lengths.

    @[simp]

    Compaction preserves the number of clauses.

    theorem Cslib.Logic.PL.CNF.mem_vars_compact_lt {V : Type u_1} [DecidableEq V] (φ : CNF V) {v : ℕ} (hv : v ∈ φ.compact.vars) :

    Every renamed variable is below the number of literal occurrences.

    theorem Cslib.Logic.PL.CNF.eval_relabel_idxOf {V : Type u_1} [DecidableEq V] (φ : CNF V) {l : List V} (hl : ∀ (v : V), v ∈ φ.vars → v ∈ l) (σ : V → Bool) :
    eval (fun (i : ℕ) => l[i]?.elim false σ) (relabel (fun (a : V) => List.idxOf a l) φ) = eval σ φ

    Renaming each variable by its position in a list l containing all variables of φ is undone by reading the names back from l.

    theorem Cslib.Logic.PL.CNF.satisfiable_relabel_idxOf {V : Type u_1} [DecidableEq V] (φ : CNF V) {l : List V} (hl : ∀ (v : V), v ∈ φ.vars → v ∈ l) :
    (relabel (fun (a : V) => List.idxOf a l) φ).Satisfiable ↔ φ.Satisfiable

    Renaming by positions in a list containing all variables preserves satisfiability.

    theorem Cslib.Logic.PL.CNF.eval_compact {V : Type u_1} [DecidableEq V] (φ : CNF V) (σ : V → Bool) :
    eval (fun (i : ℕ) => φ.vars[i]?.elim false σ) φ.compact = eval σ φ

    Reading original names at the compact positions recovers the original evaluation.

    Compaction preserves satisfiability, without requiring a finite variable type.