Il-to-Il: General otherwise elimination [archival branch] #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an IL pass that eliminates general uses of
otherwise
; general in the sense that it can handle overlapping LHS likeor rules referring to predicates:
It uses the apartness check (#16) to clean up the generated rules a bit. It could do more systematic clean up to introduce negated boolean premises in the restricted case, but doesn’t do this yet.
This PR is not for merging, but merely for archival reasons, as Andreas says we actively don’t want to support otherwise in the general form, and don’t want the necessary IL changes (a general form of negated premise).
Instead, I understand he envisions a check in the IL checker to enforce the necessary invariants (“all rules before
otherwise
have either syntactically equal or obviously apart LHS, and those that have equal LHS only have boolean premises”), and then a IL-to-IL pass that handles precisely those cases.