-
Notifications
You must be signed in to change notification settings - Fork 31
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
[CN] Extract should (allow user to) be more specific #311
Comments
Related #256 |
A new idea of naming resources, whilst chatting with Christopher: Why would we need this?Currently the Why not use the base pointer of the quantified resource?We also want to move away from the restriction of requiring a pointer in the arguments of a predicate, so the "obvious" solution of using the "base pointer" as a way to disambiguate is not general enough. Why
|
This commit is the first in a series to address rems-project#311, by allowing users to name the (quantified) resource they want to focus on. The precise syntax will probably change in response to user feedback, but right now it is `take <sym> = <resource> as <sym'>;` where "as" is a new keyword and "<sym'>" is a symbol. At this point, the latter part is optional, to preserve backwards compatibility. Only quantified predicates really _need_ names, but to forbid names on regular resources grammatically seems overly restrictive, so we shall see how that plays out. A tentative plan for how names evolve is: |--------------------------|-----------| | Owned<struct s>(..) as H | H.<field> | | Owned<ct[10]> as H | H[<index> | | focus H[<var>]; | H[<var>] | | focus H[<expr>] as H' | H' | | partial consumption | H | | unfold a user-def pred | H.<names> | Also need a way of naming the ensures of a function call. I believe there is no need to consider generating names for predicate folds because that will only happen on demand at an ensures or preceding a function call. Perhaps the "names" of the resources in the context actually need to be terms, e.g. to deal smoothly with H[<expr>].
If a program has
The current CN can move the ownership of either p[5] or q[5] out the quantified predicate. This may be harmless, or confusing, or even erroneous (though we don't have a concrete example yet). We might like to make it specific, by specifying the base pointer, but it's not obvious how this would work if we managed #303.
The text was updated successfully, but these errors were encountered: