-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support for Ghost Types #773
base: master
Are you sure you want to change the base?
Conversation
Oh, cool! Do I see it correctly that, for two instances |
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 only have one minor comment, the rest seems fine.
...ain/scala/viper/gobra/frontend/info/implementation/typing/ghost/separation/GhostTyping.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Felix Wolf <[email protected]>
I'm not the biggest fan of special casing the encoding for ghost structs as this seems rather confusing to users. Instead, I've implemented a type checker warning for this case in the separate PR #826 |
Hmm, in that case, I would rather throw a type error rather than a warning, given that The way I see it, ghost structs are useful as alternatives to ADT with a single constructor. However, for ADTs we do have a meaningful EDIT: To add to this, I had two instances where I was bitten by the unexpected semantics for |
This PR adds support for Ghost Types, i.e., the ability to mark a named type or type alias as ghost such that this type is erased. This feature came up in the context of structs that are declared for verification-only purposes and, thus, contain only ghost fields.
In addition, this PR makes
PPermissionType
andPPredType
ghost types, which did not use to be the case.