code wiki / _hdl_build / nx_research_phys_gate.nx
nx_research_phys_gate.nx
buildroot/runtime/_hdl_build/nx_research_phys_gate.nx
about
nx_research_phys_gate.nx -- the research-engine reproducibility loop in the THIRD domain: PHYSICS (operator:
"discover new capabilities through different math/chemistry/physics via simulations... s class exceed on
research AND reproducibility"). RESEARCHER confirms the foundationed physics reference (CODATA Fundamental
Physical Constants) is in the no-link-rot library. TESTING-TEAM simulates classical-mechanics events and
REPRODUCES the known outcomes: elastic-collision velocities (incl. the Newton's-cradle equal-mass swap) and
projectile kinematics (range/height/flight-time closed forms). VERIFIER checks the conservation laws and a
liar-kill: an INELASTIC collision conserves momentum but VIOLATES kinetic-energy conservation -- which is
exactly what distinguishes elastic from inelastic, so the verifier can't be fooled. Exact integer (no float).
GREEN iff 6/6. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_library.nxnx_gate_verdict.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
| none |
functions
| 14 | func g_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-");m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1}; sys_write(1,o,k); return 0 } |
| 16 | func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" "); g_w(id); g_w(": "); if ok==1 { g_w("OK\n"); pass[0]=pass[0]+1 } else { g_w("FAIL\n") } return 0 } |
| 18 | func rs_has(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: rs_lib_contains |
| 25 | func rs_lib_contains(needle: *u8) -> i64 |
| 35 | func el_v1(m1: i64, m2: i64, u1: i64, u2: i64) -> i64 { return ((m1-m2)*u1 + 2*m2*u2) / (m1+m2) } called by 1: main |
| 36 | func el_v2(m1: i64, m2: i64, u1: i64, u2: i64) -> i64 { return ((m2-m1)*u2 + 2*m1*u1) / (m1+m2) } called by 1: main |
| 37 | func momentum(m1: i64, m2: i64, a: i64, b: i64) -> i64 { return m1*a + m2*b } called by 1: main |
| 38 | func ke2(m1: i64, m2: i64, a: i64, b: i64) -> i64 { return m1*a*a + m2*b*b } // 2x kinetic energy (avoids the 1/2) called by 1: main |
| 40 | func main() -> i64 |