Expand description
Bit-blasting: BoundedExpr datapath (bitvector) operations → boolean ProofExpr.
A bitvector is represented LSB-first as a Vec<Bit>, each Bit either a known constant
or a boolean ProofExpr (a signal bit name#i, or a gate). Every combinator
constant-folds, so a constant operand collapses gates instead of emitting them — the CNF
stays small. Each operation is the textbook circuit: ripple-carry add/sub, array
multiplier, barrel shifters, magnitude/signed comparators, slice and concat.
This is the data-path half of the certified-prover seam: combined with the Boolean
lowering in super::sva_to_proof, multi-bit hardware obligations reduce to a
propositional formula our CDCL→RUP tiers discharge — in the browser, no Z3.
Structs§
- Blast
Size - The cost of turning one blasted obligation into a
ProofExpr. - Blast
Work - ★ THE BLASTER’S WORK, COUNTED — not timed. What a blast costs is three walks: the datapath expression it is handed (every node blasted once — a node blasted twice doubles the work per level above it), the gates it allocates (no gate is shared by value, so every allocation is a gate), and the memoised walk that prices the result (every gate visited once per edge into it — a walk that forgot its memo walks the tree). Each is a count a lock can bound by the size of what it walks, and none of them moves when the machine is busy.
- Pred
- A blasted PREDICATE — one bit of the shared gate DAG.
- Word
- A blasted datapath VALUE — its bits, LSB-first, in the shared gate DAG. Cloning is a refcount bump per bit, never a copy of the circuit.
Enums§
- Blast
Refusal - Why a bit-blast produced no formula.
Constants§
- BLAST_
BUDGET_ NODES - How many
ProofExprnodes we are willing to materialise for ONE bit-blasted obligation.
Functions§
- assert_
not - Assert
¬pintocnf— the refutation obligation for a miter, clausified STRAIGHT FROM THE GATE DAG. Emits exactly the clausesCnf::assert(&Not(pred_to_proof(p)))emits, in the same order, over the same variables; it just never builds the tree to read them off. - blast_
pred - Blast a boolean-VALUED
BoundedExprinto the shared DAG. - blast_
size - What blasting
ecosts — gates allocated vs.ProofExprnodes a materialisation would hold — without materialising it.Nonewhenehas no circuit. The instrument the budget reads, and the one a lock reads to prove the blast stays linear in the datapath. - blast_
word - Blast a bitvector-VALUED
BoundedExprinto the shared DAG — the bridge for a caller that still speaks the tree form. - blast_
work - Run
fand return what it returns with the blaster work it did on this thread. - lower_
bool - Lower a boolean-VALUED datapath comparison to a
ProofExpr, orNoneif it has no circuit or its materialisation is overBLAST_BUDGET_NODES. Uselower_bool_boundedwhen the caller must tell those two apart by name. - lower_
bool_ bounded lower_boolwith the refusal NAMED. The circuit is built in the shared DAG and PRICED before anything is materialised, so an obligation past the budget costs the DAG — never the tree, and never the allocator.- lower_
bool_ within lower_bool_boundedagainst an EXPLICIT ceiling. The production ceiling isBLAST_BUDGET_NODES; a caller passing its own is how a lock proves the guard is live code — shrink the ceiling and an obligation that certifies must come backBudget, with the same arithmetic, not a special case.- pred_
size - What this predicate’s circuit costs — gates allocated vs. the
ProofExprtree a materialisation would hold. The instrument a budget reads. - pred_
to_ proof - Materialise a predicate’s
ProofExprtree. The escape hatch for a consumer that genuinely needs the tree (an SMT printer, aProofExpr-shaped prover call) — and the thing every path that only wants a CNF must NOT call, because the tree is exponentially larger than the circuit. - word_
binary - One of the width-preserving binary circuits (
And..AShr, and unaryNotona).Nonewhen the widths disagree or the op is boolean-valued — useword_comparefor those. - word_
compare - One of the boolean-valued comparisons (
Eq,ULt,SLt).Nonefor a value-producing op or a width mismatch. - word_
const - A constant word, truncated to
width. - word_
select - The mux tile:
cond ? t : e, bit by bit — the same 1-bit selectBitVecIteblasts through, so a predicated select built here and one built from aBoundedExprare the same circuit. - word_
size - What a whole WORD’s circuit costs, counting the DAG the bits SHARE exactly once — an adder’s carry chain feeds every bit above it, so pricing the bits separately would count the same gates over and over. The instrument a datapath budget reads before a miter exists.
- word_
var - A named input word: the bits
name#0 .. name#(width-1), the same signal spellingblast_wordgives aBitVecVar— so a circuit built here and one blasted from aBoundedExprshare a variable namespace and can be mitered against each other. - words_
equal - The miter:
a == bover every bit.Noneon a width mismatch.