code wiki / _hdl_build / nx_mech_engines_lib.nx
nx_mech_engines_lib.nx
buildroot/runtime/_hdl_build/nx_mech_engines_lib.nx
about
nx_mech_engines_lib.nx -- the REAL mechanistic engines as a SHARED LIBRARY (no main): the optimizer, the machine
scientist (symbolic regression), the ensemble classifier, and the heuristic planner -- the genuine algorithms
(extracted from their verified gates) so the neurosymbolic dispatch loop calls REAL code, not demo stubs (operator:
wire the remaining engines into the loop). Integer + f32, deterministic, NO LLM.
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_f32_hw.nxnx_syscalls.nx
imported by: nx_neurosym_complete_gate.nxnx_neurosym_full_gate.nx
structs
| none |
consts
| 8 | const K_MAGIC_999999999: i64 = 999999999 |
| 9 | const K_MAGIC_1024: i64 = 1024 |
functions
| 12 | func eng_optimize(target: i64) -> i64 { var bx: i64=0; var bv: i64=K_MAGIC_999999999; var x: i64=0; while x<=50 { let d: i64=x-target; let v: i64=d*d; if v<bv { bv=v; bx=x } x=x+1 } return bx } |
| 15 | func f32_le_l(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 } |
| 16 | func eng_discover(X: *i64, Y: *i64, N: i64) -> i64 |
| 30 | func eng_stump(xv: i64) -> i64 { if xv>5 { return 1 } return 0 } called by 1: eng_forest |
| 31 | func eng_forest(x1: i64, x2: i64, x3: i64) -> i64 { let v: i64=eng_stump(x1)+eng_stump(x2)+eng_stump(x3); if v>=2 { return 1 } return 0 } |
| 34 | func eng_apply(s: i64, a: i64, pre: *i64, add: *i64, del: *i64) -> i64 { return (s & (0-1-del[a])) | add[a] } called by 1: eng_plan |
| 35 | func eng_hrelax(s: i64, goal: i64, pre: *i64, add: *i64, NA: i64) -> i64 called by 1: eng_plan |
| 40 | func eng_plan() -> i64 |
| 60 | func eng_pareto_hv(f1: *i64, f2: *i64, N: i64, R: i64) -> i64 |
| 68 | func eng_sat2(cl0: *i64, cl1: *i64, ncl: i64) -> i64 called by 1: eng_prove |
| 82 | func eng_prove() -> i64 |