-
Notifications
You must be signed in to change notification settings - Fork 1
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
Lambda support #16
Merged
Merged
Lambda support #16
+1,040
−548
Conversation
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
`Expr.newLambda` expression Lambda function constructor
…with `sorry` to be completed later
…ated into the tactics
kustosz
requested changes
Nov 28, 2024
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.
Some changes needed, but this awesome! I'm glad this works and turned out so nice
… prefix to distinguish them
…ions. Accordingly, nrfn! macro had to be changed
…field. Accordingly, ugly hacks to acommodate this were fixed
kustosz
approved these changes
Dec 2, 2024
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.
This PR aims to add lambda support. To that end, the following changes have been made:
LawfulHeap
has been added. This denotes the types that can be argued with separation logic predicates. Implementors must define the operations (union and disjoint) and prove some fundamental theorems about them.SLP
now works over all types that implementLawfulHeap
.State _
has been replaced with two types that implementLawfulHeap
:ValHeap
andState
whereValHeap
is the old state andState
is a wrapper aroundValHeap
that adds a set of lambdas. We can construct lambda singletons with the[r ↣ l]
which meansr
refers to the lambdal
. This is a big change, and required many changes across the codebase.Lambda
is introduced. A lambda expressionExpr.lam
is introduced. Moreover,FunctionIdent
is extended to support references to lambda functions in the environment. Accordingly, lambda calls can be represented withExpr.call
s.let add = |a, b| : u8, u8 -> u8 { ... }
, and they can be called with^add(4 : u8, 7 : u8)
nested_triple
is added that can be used by the steps tactic to deconstruct the goals of formP {e} Q
with introduction rules of form{P1} e1 {Q} -> {P1 * H} e2 {Q * H}
, likecallLambda_intro
. Corresponding introduction rules were added and integrated into thesteps
tactic.Closes #6