code wiki / _hdl_build / _type_search_authored.nx
_type_search_authored.nx
buildroot/runtime/_hdl_build/_type_search_authored.nx
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
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
structs
| none |
consts
| 9 | const TS_K: i64 = 8 |
| 10 | const TS_NCOMP: i64 = 12 |
| 11 | const TS_MAXTERM: i64 = 30000 |
| 12 | const TS_MAXLVL: i64 = 4 |
| 13 | const TS_HCAP: i64 = 131072 |
| 14 | const TS_BUDGET: i64 = 8000000 |
functions
| 4 | func _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 } |
| 5 | func _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 } |
| 6 | func _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 } |
| 7 | func _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 } |
| 8 | func _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 } |
| 15 | func ts_arity(c: i64) -> i64 { if c == 12 { return 1 } return 2 } |
| 16 | func 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 |
| 17 | func ts_apply(c: i64, a: i64, b: i64) -> i64 called by 1: ts_search |
| 32 | func ts_vech(vecs: *i64, ix: i64) -> i64 called by 1: ts_insert |
| 39 | func ts_vec_eq(vecs: *i64, x: i64, y: i64) -> i64 called by 1: ts_insert |
| 44 | func ts_insert(vecs: *i64, hash: *i64, nterm: i64) -> i64 |
| 57 | func ts_is_target(vecs: *i64, ix: i64, kx: *i64) -> i64 called by 1: ts_search |
| 62 | func ts_search(ka: *i64, kb: *i64, kx: *i64, cons: *i64, ncon: i64, terms: *i64, vecs: *i64, hash: *i64, stats: *i64) -> i64 |
| 159 | func ts_comp_name(c: i64) -> *u8 called by 1: ts_emit_term |
| 173 | func ts_emit_term(ofd: i64, terms: *i64, ix: i64) -> i64 called by 3: ts_emit_termts_emit_modulets_corpus_line calls 5: _ts_fputs_ts_fsigts_comp_namets_emit_termts_arity |
| 183 | func ts_emit_module(path: *u8, terms: *i64, ix: i64, ka: *i64, kb: *i64, kx: *i64) -> i64 |
| 225 | func ts_corpus_line(label: *u8, verdict: *u8, terms: *i64, ix: i64, kept: i64, cand: i64) -> i64 |
| 238 | func ts_round(label: *u8, path: *u8, ka: *i64, kb: *i64, kx: *i64, cons: *i64, ncon: i64, terms: *i64, vecs: *i64, hash: *i64) -> i64 |
| 256 | func main() -> i64 |