Skip to content

dag: support term-level if-then-else (ite)#2

Merged
shaobo-he merged 1 commit into
mainfrom
ite-support
Jun 8, 2026
Merged

dag: support term-level if-then-else (ite)#2
shaobo-he merged 1 commit into
mainfrom
ite-support

Conversation

@shaobo-he

Copy link
Copy Markdown
Owner

OL1V3R's DAG paniced on 'ite' (unsupported term operation), erroring out on the one eval instance whose ite survives z3 preprocessing (protected_divide).

Add Node::Ite(cond, a, b): cond is a boolean node, the branches are terms. The condition is true iff its score is exactly 1 -- satisfied atoms score exactly one() and the wedge-mean/vee-max aggregation preserves it in both Rational and f64 -- so the branch select is exact and reuses the scores the bottom-up pass already computes. Both branches are evaluated (the linear pass touches every node) and Ite selects; the untaken branch is harmlessly discarded.

Purely additive: no non-ite formula builds an Ite node, so all other instances are byte-identical. protected_divide now solves sat across all seeds; the other five ite instances are unaffected.

OL1V3R's DAG paniced on 'ite' (unsupported term operation), erroring out on the
one eval instance whose ite survives z3 preprocessing (protected_divide).

Add Node::Ite(cond, a, b): cond is a boolean node, the branches are terms. The
condition is true iff its score is exactly 1 -- satisfied atoms score exactly
one() and the wedge-mean/vee-max aggregation preserves it in both Rational and
f64 -- so the branch select is exact and reuses the scores the bottom-up pass
already computes. Both branches are evaluated (the linear pass touches every
node) and Ite selects; the untaken branch is harmlessly discarded.

Purely additive: no non-ite formula builds an Ite node, so all other instances
are byte-identical. protected_divide now solves sat across all seeds; the other
five ite instances are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shaobo-he shaobo-he merged commit 5ad4e27 into main Jun 8, 2026
1 check passed
@shaobo-he shaobo-he deleted the ite-support branch June 8, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant