code wiki / _hdl_build / nx_machine_scientist_unified_gate.nx

nx_machine_scientist_unified_gate.nx

buildroot/runtime/_hdl_build/nx_machine_scientist_unified_gate.nx

7066 B85 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic machine
docsdependenciesstructsconstsfunctions

dependencies 4 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_f32_hw.nx nx_syscalls.nx nx_machine_scientist_unified_g

imports: nx_gate_gn.nxnx_gate_base.nxnx_f32_hw.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 f32_of discover consistent gn form_eval f32_of ↻ f32_mul f32_add f32_mul ↻ f32_div f32_int gm gn ↻ f32_int ↻ f32_mul ↻ f32_of ↻ f32_sub f32_neg f32_le f32_sub ↻ f32_abs sys_exit

structs

none

consts

none

functions

19func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
21func gm(x: i64) -> i64 { return gn(f32_int(f32_mul(x, f32_of(1000)))) }
called by 1: main
22func f32_abs(x: i64) -> i64 { return x & 0x7FFFFFFF }
called by 1: main calls 1: f32_sub
23func f32_le(x: i64, y: i64) -> i64 { let d: i64=f32_sub(x,y) & 0xFFFFFFFF; if ((d>>31)&1)==1 { return 1 } if (d & 0x7FFFFFFF)==0 { return 1 } return 0 }
25func consistent(a: i64, b: i64, i1: *i64, i2: *i64, o: *i64) -> i64 { if (a*i1[0]+b*i2[0])!=o[0] { return 0 } if (a*i1[1]+b*i2[1])!=o[1] { return 0 } if (a*i1[2]+b*i2[2])!=o[2] { return 0 } return 1 }
called by 1: main calls 1: consistent
26func discover(i1: *i64, i2: *i64, o: *i64, fa: *i64, fb: *i64) -> i64 { var cnt: i64=0; var a: i64=0-2; while a<=3 { var b: i64=0-2; while b<=3 { if consistent(a,b,i1,i2,o)==1 { fa[0]=a; fb[0]=b; cnt=cnt+1 } b=b+1 } a=a+1 } return cnt }
28func form_eval(mv: i64, vv: i64, a: i64, b: i64) -> i64 { var r: i64=f32_of(1); var i: i64=0; while i<a { r=f32_mul(r,mv); i=i+1 } i=0; while i<b { r=f32_mul(r,vv); i=i+1 } return r }
30func main() -> i64