code wiki / _hdl_build / nx_eqsat_rule_proof_test.nx
nx_eqsat_rule_proof_test.nx
buildroot/runtime/_hdl_build/nx_eqsat_rule_proof_test.nx
about
nx_eqsat_rule_proof_test.nx -- SOVEREIGN soundness proof for the eqsat rewrite
rules (algebraic-normal-form leg). Models nx_alu_divider_proof_test.nx:
a machine-checked exhaustive small-width check + a width-independent induction
argument (in comments/structure), cross-checked by triangulation legs that all
run through nx_gsim (independent of NishiLang `*`/`<<` codegen via the netlist).
WORKED EXAMPLE: certify mul x 8 == shl x 3 BY PROOF (not battery):
build LHS netlist (MUL x 8) + RHS netlist (SHL x 3), sweep x over a
representative width, assert outputs byte-identical EVERY vector.
Known answer (FAIL LOUD): "<proven> <total> " printed; exit 0 iff proven==total.
dependencies 2 imports · 0 importers
imports: nx_alu_divider.nxnx_triangulate.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const PW: i64 = 8 // representative width: sweep x in [0, 2^PW) |
functions
| 17 | func _emit_num(v: i64) -> i64 called by 1: main |
| 25 | func _nl() -> i64 { let z: *u8 = sys_mmap(2); z[0] = 10; sys_write(1, z, 1); return 0 } called by 1: main |
| 28 | func _mk(vals: *i64, cells: *NxGsimCell, g: *NxGsim) -> i64 called by 1: main |
| 32 | func main() -> i64 |