code wiki / _hdl_build / _type_search_authored.nx

_type_search_authored.nx

buildroot/runtime/_hdl_build/_type_search_authored.nx

14958 B351 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

AUTHORED BY THE NISHI BUILDER (nx_module_author type-search template) -- S3 rung-1 synthesizer. Obs-equiv bottom-up search; tutoring: specs/2026-06-09-tutoring-code-synthesis-rung1.md PART B.

dependencies 1 imports · 0 importers

nx_syscalls.nx _type_search_authored.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _ts_puts sys_write sys_mmap ts_round sys_mmap ↻ ts_search ts_insert ts_vech ts_vec_eq ts_is_target ts_arity ts_apply ts_comm _ts_puts ↻ _ts_num sys_mmap ↻ sys_write ↻ ts_corpus_line sys_openat_append _ts_fputs sys_write ↻ _ts_fnum sys_mmap ↻ sys_write ↻ ts_emit_term _ts_fputs ↻ _ts_fsig _ts_fputs ↻ _ts_fnum ↻ ts_comp_name ts_emit_term ↻ ts_arity ↻ sys_close ts_emit_module sys_openat_wr _ts_fputs ↻ ts_emit_term ↻ _ts_fnum ↻ _ts_fsig ↻

structs

none

consts

9const TS_K: i64 = 8
10const TS_NCOMP: i64 = 12
11const TS_MAXTERM: i64 = 30000
12const TS_MAXLVL: i64 = 4
13const TS_HCAP: i64 = 131072
14const TS_BUDGET: i64 = 8000000

functions

4func _ts_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: ts_roundmain calls 1: sys_write
5func _ts_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 2: ts_roundmain calls 2: sys_mmapsys_write
6func _ts_fputs(fd2: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd2,s,n); return 0 }
7func _ts_fnum(fd2: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd2,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd2,bb,k); return 0 }
8func _ts_fsig(fd2: i64, v: i64) -> i64 { if v < 0 { _ts_fputs(fd2, "0 - " as *u8); _ts_fnum(fd2, 0 - v) } else { _ts_fnum(fd2, v) } return 0 }
15func ts_arity(c: i64) -> i64 { if c == 12 { return 1 } return 2 }
16func ts_comm(c: i64) -> i64 { if c == 2 { return 1 } if c == 4 { return 1 } if c == 5 { return 1 } if c == 6 { return 1 } if c == 8 { return 1 } return 0 }
called by 1: ts_search
17func ts_apply(c: i64, a: i64, b: i64) -> i64
called by 1: ts_search
32func ts_vech(vecs: *i64, ix: i64) -> i64
called by 1: ts_insert
39func ts_vec_eq(vecs: *i64, x: i64, y: i64) -> i64
called by 1: ts_insert
44func ts_insert(vecs: *i64, hash: *i64, nterm: i64) -> i64
called by 1: ts_search calls 2: ts_vechts_vec_eq
57func ts_is_target(vecs: *i64, ix: i64, kx: *i64) -> i64
called by 1: ts_search
159func ts_comp_name(c: i64) -> *u8
called by 1: ts_emit_term
173func ts_emit_term(ofd: i64, terms: *i64, ix: i64) -> i64
183func ts_emit_module(path: *u8, terms: *i64, ix: i64, ka: *i64, kb: *i64, kx: *i64) -> i64
225func ts_corpus_line(label: *u8, verdict: *u8, terms: *i64, ix: i64, kept: i64, cand: i64) -> i64
238func ts_round(label: *u8, path: *u8, ka: *i64, kb: *i64, kx: *i64, cons: *i64, ncon: i64, terms: *i64, vecs: *i64, hash: *i64) -> i64
256func main() -> i64