The reduction emitter: clause and CNF machines #
Machinery for emitting encoded CNF formulas whose variables are mixed-radix
numerals (Tableau.flatVar): literal descriptors name a sign, a top digit,
and four digit sources (registers or constants); emitClauseTM emits one
clause from a descriptor list; emitCNFTM folds clause emitters over a
formula. Each machine's Hoare specification appends exactly the
CNF.encode-image of the denoted formula to the output accumulator.
The family drivers (one per tableauCNFFlat clause family) instantiate
these with the concrete descriptor lists mirroring each family's
definition.
A mapped clause encodes as the concatenation of its literal words.
Literal descriptor: the machine-level recipe for one literal — a sign, the hardwired top digit, and the four mixed-radix digit sources.
- sign : Bool
The literal's sign:
truefor a positive literal,falsefor negated. - tag : ℕ
The hardwired top (most significant) mixed-radix digit of the variable.
- sa : TM.DigitSrc n
Source of the first mixed-radix digit below the tag (radix
A). - sb : TM.DigitSrc n
Source of the second mixed-radix digit below the tag (radix
B). - sc : TM.DigitSrc n
Source of the third mixed-radix digit below the tag (radix
C). - sd : TM.DigitSrc n
Source of the fourth (least significant) mixed-radix digit (radix
D).
Instances For
The emitting machine of one descriptor.
Equations
- Complexity.SAT.LitDesc.tm rA rB rC rD tmp tmp2 desc = Complexity.TM.emitVarLitTM rA rB rC rD tmp tmp2 desc.sign desc.tag desc.sa desc.sb desc.sc desc.sd
Instances For
Descriptor denotation: desc denotes the literal ℓ over the work
tapes work₀ with radices A B C D, all intermediate numeral values
capped by M.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Per-descriptor emission. A denoting descriptor's machine appends the literal's encoded word, moving the scratches to the literal's variable.
Chained literal emission. A descriptor list denoting the clause cl
appends Clause.encode cl, scratches ending at the last variable
(or staying at z for the empty clause).
Denoted clause variables are capped, hence so is the scratch fold.
Emit one clause: the literals, the clause separator [1,0], and a
scratch reset (so clause emitters compose at the scratch-0 state).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Time budget of a clause emitter with at most L literals.
Equations
- Complexity.SAT.clauseBudget L M = L * (Complexity.TM.emitVarBudget M + 1) + 2 * Complexity.TM.opBudget M + 6
Instances For
emitClauseTM Hoare specification: appends
Clause.encode cl ++ [true, false], scratches 0 to 0.
Emit a CNF: fold clause emitters.
Equations
- Complexity.SAT.emitCNFTM rA rB rC rD tmp tmp2 clss = Complexity.TM.bigSeqTM (List.map (Complexity.SAT.emitClauseTM rA rB rC rD tmp tmp2) clss)
Instances For
Time budget of a CNF emitter: K clauses of at most L literals.
Equations
- Complexity.SAT.cnfBudget K L M = K * (Complexity.SAT.clauseBudget L M + 1) + 1
Instances For
emitCNFTM Hoare specification: appends CNF.encode φ, scratches
0 to 0.