code wiki / _hdl_build / nx_synth_oe.nx

nx_synth_oe.nx

buildroot/runtime/_hdl_build/nx_synth_oe.nx

6913 B178 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic synth
docsdependenciesstructsconstsfunctions

about

nx_synth_oe.nx -- the synthesizer SCALED to S-class technique: bottom-up enumerative synthesis with OBSERVATIONAL-EQUIVALENCE pruning. Two sub-programs that produce the SAME output vector on the example inputs are interchangeable, so only ONE representative per distinct behaviour is kept. The search is then bounded by the number of distinct BEHAVIOURS, not the (exponential) number of programs -- the exact technique SOTA program synthesizers use to scale, and it lets us reach depth-3+ programs the naive <=2 enumerator never could. Research: Udupa et al., "TRANSIT: Specifying Protocols with Concolic Snippets," PLDI 2013 (observational equivalence); Alur et al., EUSolver / SyGuS; Massalin, AFIPS 1987 (superoptimizer). Exceed is MEASURED: candidates tried (P) vs distinct values kept (V); P/V is the collapse the pruning buys, A/B on the same task.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_synth_oe.nx nx_synth_oe_test.nx

imports: nx_syscalls.nx

imported by: nx_synth_oe_test.nx

structs

26struct SoeCtx

consts

15const SOE_MAGIC_3750763034362895579: i64 = 3750763034362895579
16const SOE_MAGIC_1099511628211: i64 = 1099511628211
18const SOE_ADD: i64 = 0
19const SOE_SUB: i64 = 1
20const SOE_MUL: i64 = 2
21const SOE_SHL: i64 = 3
23const SOE_MAXV: i64 = 4000
24const SOE_HT: i64 = 16384 // power of two

functions

42func soe_eval(c: *SoeCtx, v: i64, x: i64) -> i64
called by 2: soe_evalmain calls 1: soe_eval
56func soe_hash(tmp: *i64, nex: i64) -> i64
63func soe_vec_eq(c: *SoeCtx, v: i64, tmp: *i64) -> i64
70func soe_lookup(c: *SoeCtx, tmp: *i64) -> i64
called by 1: soe_offer calls 2: soe_hashsoe_vec_eq
83func soe_insert(c: *SoeCtx, tmp: *i64, kind: i64, op: i64, pa: i64, pb: i64, lit: i64) -> i64
100func soe_offer(c: *SoeCtx, tmp: *i64, op: i64, pa: i64, pb: i64, lit: i64) -> i64
called by 1: soe_synth calls 2: soe_lookupsoe_insert
109func soe_synth(c: *SoeCtx, ex_x: *i64, ex_y: *i64, nex: i64, rounds: i64) -> i64
called by 1: main calls 3: sys_mmapsoe_insertsoe_offer
166func soe_new(nex: i64) -> *SoeCtx
called by 1: main calls 1: sys_mmap