Inferring Ownership Domains From Refinements
Ownership type qualifiers clarify aliasing invariants that cannot be directly expressed in mainstream programming languages. Moreover, they enable extracting abstract object graphs that clarify the object relationships produced at runtime. Adding qualifiers to legacy code after the fact, however, involves significant overhead and difficult interaction.
We propose an inference analysis to generate qualifiers in the code based on developer refinements that express strict encapsulation, logical containment and architectural tiers. The language of refinements consists of: makeOwnedBy, to make an object strictly encapsulated by another; makePartOf, to make an object logically contained in another; makePeer, to make two objects peers; or makeShared, to allow an object to be globally aliased.
Based on the developers’ refinements, the analysis attempts to generate qualifiers that type-check; if it fails to do so, it indicates to developers that their refinements do not match the code as-written, so they must investigate unexpected aliasing, and optionally change the code and re-run the analysis.
We implement the analysis in a tool, OOGRE, and evaluate it on real code, to confirm that it generates qualifiers that are more precise than the default ones. Finally, we confirm that the generated qualifiers enable another analysis to extract hierarchical object graphs that reflect strict encapsulation, logical containment and architectural tiers.
Mon 5 Nov
|13:30 - 14:00|
|14:00 - 14:30|
|14:30 - 15:00|