Documentation

CslibFrontier.Computability.Complexity.Problems.SAT.Declared

Declared-variable CNF instances, unary decoding, and malformed-word rejection #

This module packages declared-universe CNF instances as DeclaredCNF (number of declared Boolean variables numVars together with a CNF ℕ formula), declares its canonical encoding encDeclaredCNF using encUnary for numVars and encCNF for formula, and constructs the total decoder, well-formedness check, and malformed-word rejection predicate.

Main definitions #

Main results #

A CNF formula paired with an explicit upper bound numVars on its variable indices.

  • numVars : ℕ

    Number of declared variables (0, …, numVars - 1).

  • formula : Logic.PL.CNF ℕ

    The CNF formula over natural-number variable labels.

Instances For
    theorem Cslib.Complexity.encDeclaredCNF_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → Logic.PL.CNF ℕ} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn encCNF T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numVars := x0 x, formula := x1 x }) encIn encDeclaredCNF (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
    theorem Cslib.Complexity.encDeclaredCNF_formula_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → DeclaredCNF} :
    theorem Cslib.Complexity.encDeclaredCNF_numVars_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DeclaredCNF} :
    @[reducible, inline]

    The tuple of the fields of encDeclaredCNF.

    Canonical bit encoding of DeclaredCNF: unary variable bound encUnary followed by the binary-variable CNF encoding encCNF.

    theorem Cslib.Complexity.encDeclaredCNF_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → Logic.PL.CNF ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encCNF budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numVars := x0 x, formula := x1 x }) encIn encDeclaredCNF budget
    theorem Cslib.Complexity.encDeclaredCNF_formula_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DeclaredCNF} :
    Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encDeclaredCNF S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).formula) encIn✝ encCNF S✝

    Every variable occurring in x.formula lies in {0, …, x.numVars - 1}.

    x.wellFormed = true iff every occurring variable is strictly less than x.numVars.

    Embed a finite-variable Std.Sat.CNF (Fin n) formula into DeclaredCNF.

    Declared-universe model count over Finset.range x.numVars.

    Declared model counting on DeclaredCNF.ofStdSat f recovers the exact number of satisfying assignments Fin n → Bool of f.

    Well-formed declared-universe satisfiable CNF instances.

    Exact membership predicate for well-formed binary words encoding a DeclaredCNF instance; rejects both malformed framed bit words and out-of-range variable labels.

    A word satisfies declaredCNFCode iff it is the exact encoding of a well-formed DeclaredCNF.