Skip to main content

Considerate Reasoning and the Composite Design Pattern

  • Conference paper
Verification, Model Checking, and Abstract Interpretation (VMCAI 2010)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5944))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Boogie 2 code, http://people.inf.ethz.ch/summersa/wiki/lib/exe/fetch.php?media=papers:boogie-composite.zip

  2. 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)

    Chapter  Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Bierhof, K., Aldrich, J.: Permissions to specify the Composite Design Pattern. In: SAVCBS (2008)

    Google Scholar 

  6. Detlefs, D., Nelson, G., Saxe, J.B.: Simplify: a theorem prover for program checking. Journal of the ACM (52) (2005)

    Google Scholar 

  7. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software. Addison-Wesley, Reading (1995)

    Google Scholar 

  8. Jacobs, B., Piessens, F.: The verifast program verifier. Technical report, Katholieke Universiteit Leuven (August 2008)

    Google Scholar 

  9. Jacobs, B., Smans, J., Piessens, F.: Verifying the Composite Pattern using Separation Logic. In: SAVCBS (2008)

    Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. 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)

    Article  MATH  Google Scholar 

  12. 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)

    Google Scholar 

  13. Rustan, K., Leino, M.: This is Boogie 2, http://research.microsoft.com/en-us/um/people/leino/papers.html

  14. Leino, K.R.M., Monahan, R.: Reasoning about comprehensions with first-order smt solvers. In: SAC 2009. ACM, New York (2009)

    Google Scholar 

  15. Middelkoop, R., Huizing, C., Kuiper, R., Luit, E.J.: Invariants for non-hierarchical object structures. ENTCS 195, 211–229 (2008)

    Google Scholar 

  16. Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular invariants for layered object structures. Science of Computer Programming 62, 253–286 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  17. O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. In: POPL. ACM Press, New York (2004)

    Google Scholar 

  18. Parkinson, M., Bierman, G.: Separation logic and abstraction. In: POPL. ACM Press, New York (2005)

    Google Scholar 

  19. Poetzsch-Heffter, A.: Specification and verification of object-oriented programs. Habilitation thesis, Technical University of Munich (1997)

    Google Scholar 

  20. Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS. IEEE Computer Society Press, Los Alamitos (2002)

    Google Scholar 

  21. 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

  22. Sha, L., Rajkumar, R., Lehoczky, J.P.: Priority inheritance protocols: An approach to real-time synchronization. IEEE Trans. Comp. 39(9), 1175–1185 (1990)

    Article  MathSciNet  Google Scholar 

  23. 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)

    Google Scholar 

  24. Summers, A.J., Drossopoulou, S., Müller, P.: The need for flexible Object Invariants. In: IWACO 2009 (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics