code wiki / _hdl_build / nx_grammar_expand_gate.nx

nx_grammar_expand_gate.nx

buildroot/runtime/_hdl_build/nx_grammar_expand_gate.nx

9861 B149 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

dependencies 3 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_syscalls.nx nx_grammar_expand_gate.nx

imports: nx_gate_gn.nxnx_gate_base.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write sys_mmap fit sys_mmap ↻ rand_coef lcg_next merr model basis lcg_next ↻ gn model ↻ gw_cand gw ↻ sys_exit

structs

none

consts

none

functions

24func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
26func lcg_next(st: *i64) -> i64 { st[0]=((1103515245*st[0])+12345)&2147483647; return st[0] }
called by 1: fit calls 1: lcg_next
27func rand_coef(st: *i64) -> i64 { return (0-9)+(lcg_next(st)%19) } // coeff in [-9,9]
30func basis(which: i64, x: i64) -> i64
44func model(coeffs: *i64, cand: i64, x: i64) -> i64
49func merr(coeffs: *i64, cand: i64, xs: *i64, ys: *i64, n: i64) -> i64
55func fit(cand: i64, xs: *i64, ys: *i64, n: i64, seed: i64, best: *i64) -> i64
85func gw_cand(c: i64) -> i64
90func main() -> i64