Documentation

CslibFrontier.Algorithms.WordRAM.TwoSAT.Defs

Problem instances, output encoding, and output register for Word-RAM 2-SAT #

Defines Instance together with Instance.totalLits, Instance.encode, Instance.outAddrBase, Instance.wordBound, and Instance.encode_length, as well as encodeAssignment, answerWords, decodeAnswer, and Reg.outBase.

A CNF (Fin n) instance for the word-RAM 2-SAT solver.

Total literal occurrences across all clauses of G.φ.

Word-list encoding [n, |φ|] ++ φ.flatMap (encodeClauseBy Fin.val).

Output header address G.encode.length + 1, immediately past the input in State.init.

Linear word-size envelope covering input length, literal codes, and scratch memory addresses.

Encode an assignment σ : Fin n → Bool as 1 :: [(σ 0).toNat, …, (σ (n - 1)).toNat].

Canonical word-list output of the 2-SAT solver on G.

Decode a word list returned by program back to Option (Fin G.n → Bool).

@[reducible, inline]

Output-list header register (G.outAddrBase).