code wiki / _hdl_build / nx_synth_oe.nx
nx_synth_oe.nx
buildroot/runtime/_hdl_build/nx_synth_oe.nx
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
imports: nx_syscalls.nx
imported by: nx_synth_oe_test.nx
structs
| 26 | struct SoeCtx |
consts
| 15 | const SOE_MAGIC_3750763034362895579: i64 = 3750763034362895579 |
| 16 | const SOE_MAGIC_1099511628211: i64 = 1099511628211 |
| 18 | const SOE_ADD: i64 = 0 |
| 19 | const SOE_SUB: i64 = 1 |
| 20 | const SOE_MUL: i64 = 2 |
| 21 | const SOE_SHL: i64 = 3 |
| 23 | const SOE_MAXV: i64 = 4000 |
| 24 | const SOE_HT: i64 = 16384 // power of two |
functions
| 42 | func soe_eval(c: *SoeCtx, v: i64, x: i64) -> i64 |
| 56 | func soe_hash(tmp: *i64, nex: i64) -> i64 |
| 63 | func soe_vec_eq(c: *SoeCtx, v: i64, tmp: *i64) -> i64 |
| 70 | func soe_lookup(c: *SoeCtx, tmp: *i64) -> i64 |
| 83 | func soe_insert(c: *SoeCtx, tmp: *i64, kind: i64, op: i64, pa: i64, pb: i64, lit: i64) -> i64 |
| 100 | func soe_offer(c: *SoeCtx, tmp: *i64, op: i64, pa: i64, pb: i64, lit: i64) -> i64 |
| 109 | func soe_synth(c: *SoeCtx, ex_x: *i64, ex_y: *i64, nex: i64, rounds: i64) -> i64 |
| 166 | func soe_new(nex: i64) -> *SoeCtx |