Abstract
We propose Considerate Reasoning, a novel specification and verification technique based on object invariants. This technique supports succinct specifications of implementations which follow the pattern of breaking properties of other objects and then notifying them appropriately. It allows the specification to be concerned only with the properties directly relevant to the current method call, with no need to explicitly mention the concerns of subcalls. In this way, the specification reflects the division of responsibility present in the implementation, and reflects what we regard as the natural argument behind the design.
We specify and prove the well-known Composite design pattern using Considerate Reasoning. We show how to encode our approach in Boogie2. The resulting specification verifies automatically within a few seconds; no manual guidance is required beyond the careful representation of the invariants themselves.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
References
Boogie 2 code, http://people.inf.ethz.ch/summersa/wiki/lib/exe/fetch.php?media=papers:boogie-composite.zip
Banerjee, A., Naumann, D., Rosenberg, S.: Regional logic for local reasoning about global invariants. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 387–411. Springer, Heidelberg (2008)
Barnett, M., DeLine, R., Fähndrich, M., Leino, K.R.M., Schulte, W.: Verification of object-oriented programs with invariants. JOT 3(6), 27–56 (2004)
Barnett, M., Naumann, D.: Friends need a bit more: Maintaining invariants over shared state. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 54–84. Springer, Heidelberg (2004)
Bierhof, K., Aldrich, J.: Permissions to specify the Composite Design Pattern. In: SAVCBS (2008)
Detlefs, D., Nelson, G., Saxe, J.B.: Simplify: a theorem prover for program checking. Journal of the ACM (52) (2005)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software. Addison-Wesley, Reading (1995)
Jacobs, B., Piessens, F.: The verifast program verifier. Technical report, Katholieke Universiteit Leuven (August 2008)
Jacobs, B., Smans, J., Piessens, F.: Verifying the Composite Pattern using Separation Logic. In: SAVCBS (2008)
Kassios, I.T.: Dynamic frames: Support for framing, dependencies and sharing without restrictions. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) FM 2006. LNCS, vol. 4085, pp. 268–283. Springer, Heidelberg (2006)
Leavens, G.T., Leino, K.R.M., Müller, P.: Specification and verification challenges for sequential object-oriented programs. FAC 19(2), 159–189 (2007)
Leino, K.R.M., Müller, P.: Object invariants in dynamic contexts. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 491–515. Springer, Heidelberg (2004)
Rustan, K., Leino, M.: This is Boogie 2, http://research.microsoft.com/en-us/um/people/leino/papers.html
Leino, K.R.M., Monahan, R.: Reasoning about comprehensions with first-order smt solvers. In: SAC 2009. ACM, New York (2009)
Middelkoop, R., Huizing, C., Kuiper, R., Luit, E.J.: Invariants for non-hierarchical object structures. ENTCS 195, 211–229 (2008)
Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular invariants for layered object structures. Science of Computer Programming 62, 253–286 (2006)
O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. In: POPL. ACM Press, New York (2004)
Parkinson, M., Bierman, G.: Separation logic and abstraction. In: POPL. ACM Press, New York (2005)
Poetzsch-Heffter, A.: Specification and verification of object-oriented programs. Habilitation thesis, Technical University of Munich (1997)
Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS. IEEE Computer Society Press, Los Alamitos (2002)
Rosenberg, S., Banerjee, A., Naumann, D.: Local Reasoning and Dynamic Framing for the Composite Pattern and its Clients, http://www.cs.stevens.edu/~naumann/publications/RosenbergBanerjeeNaumann09a.pdf
Sha, L., Rajkumar, R., Lehoczky, J.P.: Priority inheritance protocols: An approach to real-time synchronization. IEEE Trans. Comp. 39(9), 1175–1185 (1990)
Smans, J., Jacobs, B., Piessens, F.: Implicit dynamic frames: Combining dynamic frames and separation logic. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 148–172. Springer, Heidelberg (2009)
Summers, A.J., Drossopoulou, S., Müller, P.: The need for flexible Object Invariants. In: IWACO 2009 (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Summers, A.J., Drossopoulou, S. (2010). Considerate Reasoning and the Composite Design Pattern. In: Barthe, G., Hermenegildo, M. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2010. Lecture Notes in Computer Science, vol 5944. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11319-2_24
Download citation
DOI: https://doi.org/10.1007/978-3-642-11319-2_24
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-11318-5
Online ISBN: 978-3-642-11319-2
eBook Packages: Computer ScienceComputer Science (R0)