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

3225 B78 linesdepth 8pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic eqsat
docsdependenciesstructsconstsfunctions

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

nx_alu_divider.nx nx_triangulate.nx nx_eqsat_rule_proof_test.nx

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

main _mk div_const div_op2 nx_gsim_run nx_gsim_kind_supported nx_gsim_eval_cell nx_tri_pass_strict nx_tri_check _emit_num _nl

structs

none

consts

15const PW: i64 = 8 // representative width: sweep x in [0, 2^PW)

functions

17func _emit_num(v: i64) -> i64
called by 1: main
25func _nl() -> i64 { let z: *u8 = sys_mmap(2); z[0] = 10; sys_write(1, z, 1); return 0 }
called by 1: main
28func _mk(vals: *i64, cells: *NxGsimCell, g: *NxGsim) -> i64
called by 1: main
32func main() -> i64