Modular Protocol Checker for Object-Oriented Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing protocol checking approaches in object-oriented software are either too restrictive with aliasing or not suitable for interactive development, failing to ensure correct implementation of protocols, especially in the presence of multiple references to objects.
Innovation Solution
A sound modular protocol checking approach based on typestates that uses access permissions to track and manage aliasing, allowing flexibility while ensuring protocol compliance through method implementations and inheritance handling.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If global analysis is used to check protocols, then aliasing is accounted for, but the approach is not suitable for interactive use during development
Solution Approach 1:
The patent divides the protocol checking process into modular components that can be applied incrementally during development. Instead of requiring complete global analysis, the system checks protocols method by method, allowing developers to get feedback interactively while writing code, thus resolving the contradiction between reliability and ease of operation
Solution Approach 2:
The system performs preliminary protocol checking on individual methods before full integration, allowing early detection of protocol violations. This preliminary action enables interactive development support while maintaining checking accuracy through progressive verification
2Ease of operation
If modular protocol checkers are used, then interactive development is supported, but aliasing restrictions are imposed that exclude realistic code
Solution Approach 1:
The patent introduces dynamic alias tracking that adapts to the actual aliasing patterns in the code rather than imposing static restrictions. The system dynamically determines which objects are aliased and adjusts checking accordingly, allowing realistic code with various aliasing patterns to be checked interactively
Solution Approach 2:
The system changes the parameters of alias tracking from fixed restrictions to flexible, context-dependent tracking. By monitoring actual reference patterns and adjusting checking behavior based on detected aliasing, the system maintains interactive support while accommodating diverse real-world code patterns
3Reliability
If conservative reasoning is applied to track aliasing, then protocol violations are detected, but precision in reasoning about object manipulations is reduced
Solution Approach 1:
The system applies conservative reasoning only where necessary for protocol violation detection, rather than universally. By selectively applying conservatism based on actual aliasing contexts, the system maintains sufficient precision for detecting violations while avoiding unnecessary loss of precision in object state tracking
Solution Approach 2:
The system uses feedback from actual runtime observations to refine its reasoning about object states. By monitoring actual aliasing patterns and using this feedback to adjust checking precision, the system achieves reliable violation detection while maintaining high precision in tracking object manipulations where applicable
Data Source
AI summary
A method for statically checking an object-oriented computer program module includes the step of identifying objects within a computer program module, at least one of the objects having a plurality of references thereto, possibly from multiple clients. A discipline of permissions is imposed on the objects identified within the computer program module. The permissions enable tracking, from among a discrete set of changeable states, a subset of states each object might be in. A determination is made regarding whether the imposed permissions are violated by a potential reference to any of the identified objects. The results of the determination are output to a user.


