Commit b7196b2
feat(synth): helper-composition in gen_omc (Phase 4.2) — multi-function programs
gen_omc now optionally emits 1-2 total/pure helper functions that `g` composes (calls),
mirroring the proven toolbox-composition pattern. Generated programs go from single-function
to multi-function while keeping the correct-by-construction guarantee.
- synth.rs: Gen.helpers; helper(name) emits `fn hN(x){ return <guarded int_expr over x>; }`
(total + pure → any int arg is run-safe); atom() may call a helper; program() emits helpers
before g so they register and are callable. Helpers are non-recursive (generated before being
added to scope) → always terminate.
- Verified: parse-rate 1.000 / run-rate 1.000 STILL HOLDS over 300 seeds. Full suite 267 tests pass.
- Example: seed 1 emits h1(x), h2(x) and g calls both — valid + runs.
Version 1.8.6.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent b2847a6 commit b7196b2
2 files changed
Lines changed: 39 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
60 | 86 | | |
61 | 87 | | |
62 | 88 | | |
| |||
152 | 178 | | |
153 | 179 | | |
154 | 180 | | |
155 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
156 | 191 | | |
157 | 192 | | |
158 | 193 | | |
| |||
0 commit comments