Skip to content

Keep short-circuit evaluation when hoisting case expressions - #11

Merged
nikolaushuber merged 4 commits into
mainfrom
anf-hoist-fix
Oct 26, 2026
Merged

nikolaushuber merged 4 commits into
mainfrom
anf-hoist-fix

Conversation

@nikolaushuber

Copy link
Copy Markdown
Collaborator

anf_term hoisted case expressions out of the right operand of ∧/∨/⟶,
so they were evaluated even when the left operand decided the result: e.g.
xs ≠ [] ∧ (case hd xs of …) raised on [] instead of returning False.

Such connectives are now bound via an if statement (PIf), so the right
operand is only evaluated when needed. Plain and/or output is unchanged
otherwise.

@nikolaushuber
nikolaushuber merged commit cdea3dc into main Oct 26, 2026
3 checks passed
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