-
Notifications
You must be signed in to change notification settings - Fork 63
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
The Heapster any permission #1651
Conversation
…qualities using an any permission; updated proveVarLLVMBlocks2 to allow proving block permissions of fixed static size from any permissions
if exprsUnequal e1 e2 then | ||
distPerms2 x (ValPerm_Eq e1) x (ValPerm_Eq e2) | ||
else | ||
error "simplImplIn: SImpl_IntroAnyEqEq: expressions not unequal" |
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.
Totally a minor nitpick - the double-negative phrasing in the error message ("not unequal") seems awkward here. At the same time, though, I see the intent... I'm not sure how to make it clearer. Maybe "expected unequal expressions"? It probably doesn't really matter since this is a halt-and-catch-fire situation anyway.
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.
Huh, I see what you mean. I hadn't thought about "unequal" as a negative thing, because in this context it is a positive, in that we are trying to prove unequality and in this case that proof failed. In the end, though, I think you're right, it probably doesn't really matter. The main content of the error message is actually just the name of the rule that failed...
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.
Looks good to me - I left a comment on an error message that maybe could have been phrased better, but approved the changes since it doesn't matter that much / the intent behind the original phrasing is clear.
This PR adds a new false / inconsistent permission
any
, which translates to the SAW core unit type. This is as opposed to thefalse
permission, which translates to the inconsistentFalse
type. The reason we needany
is in order to combine inconsistent permissions whose translations are not inconsistent types. For instance, if we have permissionsx : eq(llvmword(0)) or ptr((W,0) |-> p1) , x:ptr((W,8) |-> p2)
we know in the Heapster type system that
x
cannot have permissioneq(0)
, because the second permission ensuresx
is a pointer. The translation of these permissions is the type(unit + [| p1 |]) * [| p2 |]
, however, where the second element of the pair does not in any way guarantee the the first element is not a left-hand element of the sum type. This sort of situation comes up in Rust functions withOption
of reference return values, like this one:The input lifetime ownership permission for this function is something like
a:lowned (l:List64 -o l:List64)
, while the output permission isa:lowned (ret: eq(0) or ptr((W,0) |-> u64) -o l:List64)
. In order to prove the output lifetime ownership permission from the input one in theSome
case, we have a situation like the above for the contravariant implication needed for the input permissions of thelowned
permissions, where we have to proveret: eq(0) or ptr(...)
plus theptr
permission forret
impliesl:List64
.