-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Representation for mapping atoms that can handle intersection and difference #991
Comments
Putting this into English and our terminology, this is saying that the atomic mapping representation has an additional component, E, which is a finite set of types. Each type s in E adds a constraint that there is a field f such that the name is not one of the individual field names and value of f is in s. More precisely what this representation does is to allow the representation of mapping type to be turned into a union of these atomic types. I don't yet grok this. |
This assumes E in Frisch thesis (ref ballerina-platform#991) is empty and no distinction between readonly and non-readonly cases
PDF incase of rendering issues in github Design for negative atomsI shall start the explanation from the de# CastagnaPaper and then extend that to the more general case in FrishThesis. In page 61 of the CastagnaPaper he provide 2 representations for negative atoms as,
I believe 1 is sufficient for nBallerina as well (though we may choose to represent every thing using 2) and we can already represent this using our representation of mappings. So I'll limit the rest to extending 2 to match ballerina's requirements. Since we can already represent the first and second components of the union we shall focus only on the representation of the final component. In the foot note 29 (in page 47) Castagna calls these records "Quasi-open records" defined as, My intuition here is that in order to get the set of records where there must be "not-undefined" fields other than Now let's extend this to our idea of open records where the rest must be of a given type where Based on the foot note 29 I think this If my intuition for the "Quasi-open records" is correct what we need to do to get ExampleAs an example lets consider {| not(byte) x|} | {|not(byte) y|} | ({| byte x; byte y; ...any |} - { any x; any y; ...byte}); That is the union of records where Implementation detailsIn the previous section I limited the usage of |
Record difference worked examplesI will be using the notation Examples verified by Cduce
Examples worked by hand
|
Step by step worked examples Open records (from 2nd example above)
Closed records (from example 1 above)
Controlled open records (last of the examples worked by hand)
Uniqueness of the negative atom representationNote that this representation for the not (negative) of a record is not unique since each element in the union overlaps each other. |
Thanks for the explanation. It's not clear whether this representation will be helpful for us. |
I think we should put this on pause for now. |
Section 9.1.4 (page 177) if the Frisch thesis has a way of representing records that can represent intersection and difference. There is a mentioned in footnote 29 of the April 1 version of the Castagna paper.
Here's the relevant section.
The text was updated successfully, but these errors were encountered: