Documentation

CslibFrontier.Algorithms.WordRAM.PPSZ.Clauses

The w-implication search on stored clauses #

The word-RAM program Cslib.Algorithms.WordRAM.PPSZ.impliedCode decides w-implication (Cslib.Complexity.PPSZ.WImplied) by the finite search Cslib.Complexity.PPSZ.impliedTest, run on addresses instead of clauses and literals. A choice of clauses is a list of the addresses where their encodings start (Cslib.Algorithms.WordRAM.PPSZ.clauseAddrs), and a choice of literals is a list of the addresses of their codes in those encodings. This file states that search on stored data (Cslib.Algorithms.WordRAM.PPSZ.addrTest) and proves that it is impliedTest (Cslib.Algorithms.WordRAM.PPSZ.addrTest_eq).

Main definitions #

Main results #

Sections under maps #

theorem Cslib.Algorithms.WordRAM.PPSZ.sections_map_map {α : Type u_1} {β : Type u_2} (f : α → β) (L : List (List α)) :

Sections commute with mapping every entry.

theorem Cslib.Algorithms.WordRAM.PPSZ.any_congr_of_mem {α : Type u_1} {l : List α} {f g : α → Bool} (h : ∀ a ∈ l, f a = g a) :
l.any f = l.any g

List.any depends only on the values of the test on the list.

Clause addresses #

The addresses where the encodings of the clauses of φ start, when the encoding of φ starts at address a.

The clause of φ whose encoding starts at address p, when the encoding of φ starts at address a (the empty clause at other addresses).

Clause addresses lie in the encoding, with their clause.

The clauses at the clause addresses are the clauses of φ.

Clause addresses are duplicate-free.

The encoding of the clause stored at a clause address.

theorem Cslib.Algorithms.WordRAM.PPSZ.mem_clauseAddr {n : ℕ} {mem : ℕ → ℕ} {a : ℕ} {φ : Logic.PL.CNF (Fin n)} (hφ : WordRAM.Block.HoldsList a (Schoening.encodeClauses φ) mem) {p : ℕ} (hp : p ∈ clauseAddrs a φ) :
mem p = List.length (clauseOf a φ p)

The length word of the clause stored at a clause address.

theorem Cslib.Algorithms.WordRAM.PPSZ.map_range'_clauseOf {n : ℕ} {mem : ℕ → ℕ} {a : ℕ} {φ : Logic.PL.CNF (Fin n)} (hφ : WordRAM.Block.HoldsList a (Schoening.encodeClauses φ) mem) {p : ℕ} (hp : p ∈ clauseAddrs a φ) :

The codes of the literals of the clause stored at a clause address.

The odometer step of a clause address: the next clause starts after the length word and the literals; after the last clause comes the end of the encoding.

theorem Cslib.Algorithms.WordRAM.PPSZ.headD_clauseAddrs {n a : ℕ} {φ : Logic.PL.CNF (Fin n)} (hφ : φ ≠ []) (d : ℕ) :
(clauseAddrs a φ).headD d = a

The first clause address is the start of the encoding.

theorem Cslib.Algorithms.WordRAM.PPSZ.succIn_range' {s k e : ℕ} (he : e ∈ List.range' s k) :
succIn (List.range' s k) e = if e + 1 = s + k then none else some (e + 1)

The odometer step of a literal address: the next address, up to the end of the clause.

Compatibility through codes #

Whether the literal with code c is not falsified when the partial assignment stored as the words tw v is changed to set the variable x to !b, where b is 0 or 1.

Compatibility through codes: no literal is falsified, and no code is the code of the complement c ^^^ 1 of another.

theorem Cslib.Algorithms.WordRAM.PPSZ.compatCodes_map_litCode {n : ℕ} {mem : ℕ → ℕ} {Tb : ℕ} {τ : Fin n → Option Bool} (hτ : PPZ.PartialAt mem Tb τ) (x : Fin n) (b : Bool) (ls : List (Logic.PL.Literal (Fin n))) :
compatCodes (fun (v : ℕ) => mem (Tb + v)) (↑x) b.toNat (List.map Schoening.litCode ls) = Complexity.PPSZ.compatible (Function.update τ x (some !b)) ls

Compatibility through codes is compatibility of the literals, with x set to !b.

The search on stored data #

def Cslib.Algorithms.WordRAM.PPSZ.addrTest {n : ℕ} (mem : ℕ → ℕ) (C Tb : ℕ) (φ : Logic.PL.CNF (Fin n)) (s x b : ℕ) :

The w-implication search on stored data: the clauses of φ are stored from address C, and the words of a partial assignment from Tb. The search accepts if the word of x is b, or some choice of s clause addresses has no compatible choice of literal addresses.

The word of a stored value is b exactly when the value is b.

theorem Cslib.Algorithms.WordRAM.PPSZ.addrTest_eq {n : ℕ} {mem : ℕ → ℕ} {C Tb : ℕ} {φ : Logic.PL.CNF (Fin n)} {τ : Fin n → Option Bool} (hφ : WordRAM.Block.HoldsList C (Schoening.encodeClauses φ) mem) (hτ : PPZ.PartialAt mem Tb τ) (s : ℕ) (x : Fin n) (b : Bool) :
addrTest mem C Tb φ s (↑x) b.toNat = Complexity.PPSZ.impliedTest φ s τ x b

The search on stored data is the w-implication search Cslib.Complexity.PPSZ.impliedTest, when the clauses of φ are stored from C and the partial assignment τ from Tb.