Use auto unfold for some Logic operators#1014
Open
oskgo wants to merge 3 commits into
Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
Author
|
This is going go make a lot of unfolds useless. At the meeting we decided to also make a PR to warn on unfolds that don't do anything. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As suggested in #431 (comment)
We do so for the following operators:
idfun\o\o2pred0predTpredCpred1predC1rel0relTrelCThese all share the property that they reduce down to an expression simpler than the original and should only be used as arguments to higher order functions like those in Bigop.
I also ran across a bug where declarations such as
def foo (x y: int) / = trueauto-unfolded after being given only one argument rather than requiring two. This PR fixes that as well. The fix is a one-liner, so it shouldn't be necessary to split up the PR IMO.The library changes are a breaking change since it makes simplification more powerful, which can remove bindings. The breakage in the stdlib and examples is mostly due to the use of
predTin bigops. I also fixed a few spurious errors due to smt calls failing, which might only be a difference between my machine and CI.