code wiki / _hdl_build / nx_ncf_state_gate.nx

nx_ncf_state_gate.nx

buildroot/runtime/_hdl_build/nx_ncf_state_gate.nx

5039 B62 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic ncf
docsdependenciesstructsconstsfunctions

about

nx_ncf_state_gate.nx -- X-AUT-NCF-001 RUNG 5: SYNTHESIZE A TWO-STATE LINEAR RECURRENCE -- the QUALITATIVE jump the Fibonacci boundary revealed. Every prior construct (rungs 1-4) has ONE accumulator; this is the first with TWO registers (a,b) updated in parallel each step: (a,b) <- (paa*a+pab*b, pba*a+pbb*b); return a. That makes it small-PROGRAM synthesis, not curve-fitting -- it covers Fibonacci/Lucas/Pell (order-2 linear recurrences) that NO single-accumulator loop can express. Decisive negative control: rung-4 quadratic-index (the strongest single-accumulator construct) PROVABLY FAILS on Fibonacci -> two-state is NECESSARY. T1 linear FAILS on Fibonacci. T2 rung-4 quadratic-index loop FAILS on Fibonacci -> two-state necessary. T3 two-state SYNTHESIZES Fib = a=0,b=1; (a,b)<-(b, a+b); return a. T4 MATERIALIZE+GOD-BUILD+run HELD-OUT {8->21, 9->34} -> 21034. T5 unified ncf_synth routes Fib (kind=5). Construct ladder: linear < conditional < simple-loop < affine-index < quadratic-index < TWO-STATE. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_ncf_synth.nx nx_syscalls.nx nx_ncf_state_gate.nx

imports: nx_ncf_synth.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 ncf_w sys_write sys_mmap sys_openat_wr sys_write ↻ sys_close ncf_search_linear ncf_op_eval ncf_n sys_write ↻ sys_mmap ↻ ncf_search_loop3 ncf_loop_eval3 ncf_search_loop4 ncf_loop_eval4 ncf_emit ncf_emit_branch sys_mmap ↻ ncf_cat ncf_cat_pred ncf_cat ↻ ncf_catn sys_mmap ↻ ncf_cat_ret ncf_cat ↻ ncf_catn ↻ ncf_emit_main ncf_cat ↻ ncf_cat_arg ncf_cat ↻ ncf_catn ↻ ncf_catn ↻ sys_openat_wr ↻ sys_write ↻ sys_close ↻ ncf_emit_loop sys_mmap ↻ ncf_cat ↻ ncf_catn ↻

structs

none

consts

none

functions

15func main() -> i64