Scratch register layout and encoded-clause memory invariants #
Internal layout definitions, register-disjointness tactic macros, and ClauseMemAt readback lemmas
for the Word-RAM 2-SAT solver.
@[reducible, inline]
Clause count G.φ.length.
Discharge register inequality goals on Fin 28.
Rewrite register reads past non-overlapping register/memory updates.
Normalize memory reads across Data.set and Data.write.
theorem Cslib.Algorithms.WordRAM.TwoSAT.Instance.fits_of_le {G : Instance} {w x : ℕ} (hfit : WordRAM.Fits w G.wordBound) (hle : x ≤ G.wordBound) :
WordRAM.Fits w x
Base address of the DFS scratch layout right after the output buffer.
def Cslib.Algorithms.WordRAM.TwoSAT.ClauseMemAt {n : ℕ} (mem : ℕ → ℕ) (p : ℕ) (cs : Logic.PL.CNF (Fin n)) :
Contiguous clause-encoding readback invariant starting at address p.
theorem Cslib.Algorithms.WordRAM.TwoSAT.clauseMemAt_cons {n : ℕ} {mem : ℕ → ℕ} {p : ℕ} {c : Logic.PL.Clause (Fin n)} {cs : Logic.PL.CNF (Fin n)} (h : ClauseMemAt mem p (c :: cs)) :
mem p = List.length c ∧ (∀ (i : ℕ) (hi : i < List.length c), mem (p + 1 + i) = ClauseCode.litCodeBy Fin.val c[i]) ∧ ClauseMemAt mem (p + 1 + List.length c) cs