code wiki / _hdl_build / _cegis_authored.nx
_cegis_authored.nx
buildroot/runtime/_hdl_build/_cegis_authored.nx
about
AUTHORED BY THE NISHI BUILDER (nx_module_author cegis template) -- S3.5 mechanized CEGIS.
search<->oracle counterexample loop; tutoring: specs/2026-06-09-tutoring-code-synthesis-rung1.md
+ the S3 impostor lesson in projects/2026-06-09-code-synthesis-sclass-exceed-roadmap.md.
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
| 10 | const CG_KMAX: i64 = 32 |
| 11 | const CG_NCOMP: i64 = 12 |
| 12 | const CG_MAXTERM: i64 = 30000 |
| 13 | const CG_MAXLVL: i64 = 4 |
| 14 | const CG_HCAP: i64 = 131072 |
| 15 | const CG_BUDGET: i64 = 8000000 |
| 16 | const CG_MAXROUND: i64 = 10 |
functions
| 5 | func _cg_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 6 | func _cg_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 } |
| 7 | func _cg_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 } |
| 8 | func _cg_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 } |
| 9 | func _cg_fsig(fd2: i64, v: i64) -> i64 { if v < 0 { _cg_fputs(fd2, "0 - " as *u8); _cg_fnum(fd2, 0 - v) } else { _cg_fnum(fd2, v) } return 0 } |
| 17 | func cg_arity(c: i64) -> i64 { if c == 12 { return 1 } return 2 } |
| 18 | func cg_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: cg_search |
| 19 | func cg_apply(c: i64, a: i64, b: i64) -> i64 |
| 34 | func cg_vech(vecs: *i64, ix: i64, kk: i64) -> i64 called by 1: cg_insert |
| 41 | func cg_vec_eq(vecs: *i64, x: i64, y: i64, kk: i64) -> i64 called by 1: cg_insert |
| 46 | func cg_insert(vecs: *i64, hash: *i64, nterm: i64, kk: i64) -> i64 |
| 59 | func cg_is_target(vecs: *i64, ix: i64, kx: *i64, kk: i64) -> i64 called by 1: cg_search |
| 64 | func cg_search(ka: *i64, kb: *i64, kx: *i64, kk: i64, cons: *i64, ncon: i64, terms: *i64, vecs: *i64, hash: *i64, stats: *i64) -> i64 |
| 161 | func cg_eval(terms: *i64, ix: i64, a: i64, b: i64) -> i64 |
| 171 | func cg_oracle(oid: i64, a: i64, b: i64) -> i64 |
| 179 | func cg_find_cex(terms: *i64, r: i64, oid: i64, ka: *i64, kb: *i64, kx: *i64, kbox: *i64) -> i64 |
| 201 | func cg_comp_name(c: i64) -> *u8 called by 1: cg_emit_term |
| 215 | func cg_emit_term(ofd: i64, terms: *i64, ix: i64) -> i64 called by 3: cg_emit_termcg_emit_modulecg_corpus_line calls 5: _cg_fputs_cg_fsigcg_comp_namecg_emit_termcg_arity |
| 225 | func cg_emit_module(path: *u8, terms: *i64, ix: i64, ka: *i64, kb: *i64, kx: *i64, kk: i64) -> i64 |
| 266 | func cg_corpus_line(label: *u8, verdict: *u8, terms: *i64, ix: i64, rounds: i64, kk: i64, cand: i64) -> i64 |
| 280 | func cg_solve(label: *u8, path: *u8, oid: i64, cons: *i64, ncon: i64, terms: *i64, vecs: *i64, hash: *i64) -> i64 |
| 326 | func main() -> i64 |