-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fill in missing type substitutions #2984
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
443732f
chore: Rename local variables to something more readable
RustanLeino aef58cf
fix: Clone extreme-predicate body when making prefix predicate
RustanLeino 1c90050
fix: Substitute types in Substitute(Expression)
RustanLeino dfa8ad6
Add tests
RustanLeino 1baa9bf
Make sure to collect triggers on the cloned prefix-predicate Body
RustanLeino 8b69cbf
Add release notes
RustanLeino 685a806
Merge branch 'master' into issue-2947
RustanLeino 7e67cd6
When there’s no focal predicate, say so more clearly
RustanLeino a74bae0
Don’t emit trigger warnings for extreme-into-prefix rewrites
RustanLeino aa41e2f
Merge branch 'master' into issue-2947
RustanLeino e6fadca
Merge branch 'master' into issue-2947
RustanLeino c8d660d
Merge branch 'master' into issue-2947
RustanLeino 8344691
Improved code re PrefixLemma and PrefixPredicate declarations
RustanLeino cb857c6
chore: Fix spelling in code
RustanLeino b98fba5
Merge branch 'master' into issue-2947
RustanLeino c6a91ee
Merge branch 'master' into issue-2947
keyboardDrummer b0d0eaf
Merge branch 'master' into issue-2947
RustanLeino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have each language construct be as independent as possible. For extreme lemmas and predicates this would also mean they have mostly outwards references. Would it be possible to achieve this?
Would it be possible to translate extremes to their prefix versions and then forget about the originals? Or maybe create the prefix versions next to the originals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need both. A program needs the extremes, since that's what you'll ultimately will use for the property you want. The prefix predicates/lemmas give a way to prove properties about the extremes, so they are also needed.
Actually, the more surprising thing (to me) is that
AllCallables
(which excludes the prefix versions) is used so many times.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but can we place both side by side instead of introducing
AllCallablesIncludingPrefixDeclarations
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. The
AllCallablesIncludingPrefixDeclarations
andAllCallables
properties are declared side by side. Are you perhaps suggesting that the prefix predicates/lemmas be placed in the list of the enclosing module's top-level-decls (rather than being linked off the corresponding extreme predicate/lemma)? (And if so, do you think that will improve the organization for other parts of the implementation?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's what I meant.
I think so. If I understand extreme lemma's correctly, they behave similarly to as if you'd written the prefix lemma manually next to them. Also, looking at usages of
ExtremeLemma.PrefixLemma
gives the impression there's a handful of snippets that handle the PrefixLemma as if it was a top level method.Code like this:
or this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into this in detail for
.PrefixLemma
and.PrefixPredicate
. In places where the code looked like your first example, I changeAllCallables
toAllCallablesIncludingPrefixDeclarations
. I also improved code in the various other visitors, making use of newer C# constructs. And I improved the iteration over declarations inIsEssentiallyEmptyModuleBody()
, to be more exact than before.In the code base, what happens with extreme lemmas/predicates and prefix lemmas/predicates is quite varied. In some places, the extreme declaration is used and the prefix version ignored. In other places, it's the other way around. And in some places, the two are handled in different ways. Therefore, I suggest that any further improvements be done separately from this PR.