artdag: Phase 7 optimisation laws as confluent maude module + 11 tests
lib/artdag/optimize-rules.sx — the effect-pipeline optimisation passes (identity elim, no-op/zero-radius elim, adjacent fusion, idempotent over dedup) as a maude module. Radius algebra is _+_ [assoc comm id: 0] (NOT Peano successor rules, which are non-confluent here); mau/confluent? certifies 0 non-joinable critical pairs, so the optimised pipeline's normal form / content id is rewrite-order stable. Consumes lib/maude/confluence.sx. maude-optimize 25/25, total 183/183. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ edges.
|
||||
|
||||
## Status (rolling)
|
||||
|
||||
`bash lib/artdag/conformance.sh` → **172/172** (11 suites: dag, analyze, plan, execute, optimize, fed, cost, serialize, stats, fault, maude-optimize)
|
||||
`bash lib/artdag/conformance.sh` → **183/183** (11 suites: dag, analyze, plan, execute, optimize, fed, cost, serialize, stats, fault, maude-optimize)
|
||||
|
||||
Base roadmap (Phases 1–6) COMPLETE. Now extending.
|
||||
|
||||
@@ -156,7 +156,7 @@ declaratively and prove it equivalent to the hand-written `optimize.sx`.
|
||||
- [ ] Equivalence: assert the maude-optimised DAG == `optimize.sx`'s output on
|
||||
the existing fixtures (same nodes, same content ids) — the rule set must cover
|
||||
at least the hand-written passes.
|
||||
- [ ] Confluence / CID-stability check: **consume `mau/confluent?` from
|
||||
- [x] Confluence / CID-stability check: **consume `mau/confluent?` from
|
||||
`lib/maude/confluence.sx`** — do NOT build your own checker. Assert the
|
||||
optimisation rule module is confluent (`(mau/confluent? rules-module)` is
|
||||
true) so different rewrite orders reach the same normal form and the optimised
|
||||
@@ -184,6 +184,26 @@ be an op token.
|
||||
|
||||
## Progress log
|
||||
|
||||
- **2026-06-19 Phase 7 — optimisation laws + confluence** (maude-optimize 25/25,
|
||||
total 183/183). `lib/artdag/optimize-rules.sx`: the effect-pipeline optimisation
|
||||
passes as a maude module `ARTDAGOPT` — `id(I)=I`, `blur(I,0)=I`, `bright(I,0)=I`,
|
||||
adjacent fusion `blur(blur(I,M),N)=blur(I,M+N)` (+bright), idempotent
|
||||
`over(I,I)=I`. Key result: the radius algebra is `_+_ [assoc comm id: 0]` (unary
|
||||
`1`s), NOT Peano successor rules — the Peano version is non-confluent (6
|
||||
non-joinable critical pairs: `M+0` sticks, `(A+B)+C` vs `A+(B+C)` doesn't join),
|
||||
whereas AC+id makes `(mau/confluent? artdag/opt-module)` true (0 non-joinable
|
||||
pairs) by joining those overlaps via canonical form. So the optimised pipeline's
|
||||
normal form — and hence its content id — is stable under any rewrite order.
|
||||
`artdag/opt-normal-form`/`opt-reduce-term`/`opt-canon` reduce a surface pipeline;
|
||||
`opt-same-form?` decides content-id equality; `opt-confluent?`/`opt-non-joinable`
|
||||
/`opt-non-joinable->strs` consume `lib/maude/confluence.sx` (loaded into the
|
||||
maude-optimize suite). Tests: confluence holds, every law fires, fusion is
|
||||
rewrite-order stable, laws compose, dedup vs no-dedup, distinct pipelines stay
|
||||
distinct. Gotcha: compare reduced *strings* (`mau/creduce->str`) — canon term
|
||||
objects compare unequal under `=` even when the printed normal form is identical.
|
||||
Remaining Phase 7: bridge the maude normal form back to a runnable DAG +
|
||||
equivalence-with-`optimize.sx`.
|
||||
|
||||
- **2026-06-07 Phase 7 — maude-bridge** (maude-optimize suite 14/14, total 172/172).
|
||||
`lib/artdag/maude-bridge.sx`: lossless adapter between an artdag effect DAG and a
|
||||
maude term. `artdag/dag->term dag id` walks from a sink, emitting `(mau/app op
|
||||
|
||||
Reference in New Issue
Block a user