-
Notifications
You must be signed in to change notification settings - Fork 50
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
Renamings #955
Renamings #955
Conversation
`#[ghost]` -> `#[logic]` `#[logic]` -> `#[logic(prophetic)]` `#[predicate]` -> `#[predicate]` and `#[predicate(prophetic)]`
71029a9
to
04ef3b2
Compare
Can you comment on this a bit? Why do we need to introduce this distinction? I thought the purpose of "final borrows" was in part to solve soundness issues with logical definitions and ghost code without having to do this. cc @jhjourdan I think if we go this way we should more seriously consider the implications on usability and the overall Pearlite language. If we forbid prophecies in some definitions but not in others, this seems to map to what Dafny calls Secondarily, I would like to remove |
I'm responsible for suggesting this change @arnaudgolfouse is simply implementing it. The motivation is that it is weird to have
I don't remember all the discussions we had, but it seems clear to me that if we want to allow snapshots and allow to do something with them (e.g., compare them), then it is necessary to make sure that snapshots are not prophetic. And of course, we need prophecies in specifications. I don't think I've ever promised to lift this distinction. The improvement of "final borrows" is that we now have a simple syntactic criterion to determine if a logical term is not prophetic: a logical term is not prophetic if it does not have ^ in it and if it does not call prophetic functions. In particular, instantiating a generic logical function cannot make it suddenly prophetic (which was not the case before, becaue of equality).
Our idea was that the "prophetic" qualification would be limited to advanced users. Indeed, in most common cases, mutable borrows are limited to functions parameters, and the prophecy operator don't need to be used outside of specifications. So, in tutorial, we would not teach
I don't see why this would interact with the current proposal. That being said, if we want this, there are clearly lots of discussions to have. First, Dafny's |
This is unambiguously a good cleanup.
I do recall this conversation now that you mention it. LGTM after explanation. |
My implementation of |
Various renamings to prepare for ghost code with ownership
Ghost
type ->Snapshot
gh!
->snapshot!
#[ghost]
->#[logic]
#[logic]
->#[logic(prophetic)]
#[predicate]
->#[predicate]
and#[predicate(prophetic)]