-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add disjointness reasoning for BbML #260
base: hkmc2
Are you sure you want to change the base?
The head ref may contain hidden characters: "outer\u{1F30C}"
Conversation
|
||
|
||
fun annohelper: Region[outer] ->{outer} @outer Pair[out Ref[Int, out outer], out Ref[Int, out Any]] | ||
fun annohelper: [outer, T extends outer] -> Region[T] ->{T} Pair[out Ref[Int, out T], out Ref[Int, out Any]] |
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.
A more natural signature could be
fun annohelper: [outer, T extends outer] -> Region[T] ->{T} Pair[out Ref[Int, out T], out Ref[Int, out Any]] | |
fun annohelper: [outer, T] -> Region[T] ->{T | outer} Pair[out Ref[Int, out T], out Ref[Int, out outer]] |
Does it work? If it does, it would be good to add it to the test file (in addition to the existing one).
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.
No, it doesn't. We can only track the evidence that r2 <: ~outer
, but not r2 <: ~T
. So this code will be rejected.
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.
Why would we need r2 <: ~T
here?
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.
The disjointness requirement is (T | outer) & r2 <: bot
, i.e., (T & r2) | (outer & r2) <: bot
. Then only the second subterm (outer & r2) <: bot
can be solved. The equivalent one should be T & outer
instead.
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.
Right, right, ofc.
|
||
|
||
fun annohelper: Region[outer] ->{outer} @outer Pair[out Ref[Int, out outer], out Ref[Int, out Any]] | ||
fun annohelper: [outer, T extends outer] -> Region[T] ->{T} Pair[out Ref[Int, out T], out Ref[Int, out Any]] |
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.
Why do we have Any
in Ref[Int, out Any]
?
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.
Because the second reference returned by fork
is located in r2
. It is extruded after we leave the scope of r2
. But it can be written as out ~outer
.
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.
Yes, ~outer
is what I meant in my other comment.
BTW, since you are modifying the way forall types are printed. Why not print them like in the source? Eg |
outer
variables forfunctionspolymorphic typesThis PR is still being prepared, e.g., containing redundant code. Such problems will be addressed after the main problems are discussed in the meeting.