Skip to main content

Verifying Generics and Delegates

  • Conference paper
ECOOP 2010 – Object-Oriented Programming (ECOOP 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6183))

Included in the following conference series:

Abstract

Recently, object-oriented languages, such as C\(^\sharp\), have been extended with language features prevalent in most functional languages: parametric polymorphism and higher-order functions. In the OO world these are called generics and delegates, respectively. These features allow for greater code reuse and reduce the possibilities for runtime errors. However, the combination of these features pushes the language beyond current object-oriented verification techniques.

In this paper, we address this by extending a higher-order separation logic with new assertions for reasoning about delegates and variables. We faithfully capture the semantics of C\(^\sharp\) delegates including their capture of the l-value of a variable, and that “stack” variables can live beyond their “scope”. We demonstrate that our logic is sound and illustrate its use by specifying and verifying a series of interesting and challenging examples.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Ahrendt, W., Baar, T., Beckert, B., Bubel, R., Giese, M., Hähnle, R., Menzel, W., Mostowski, W., Roth, A., Schlager, S., Schmitt, P.H.: The KeY tool. Software and System Modeling 4, 32–54 (2005)

    Article  Google Scholar 

  2. Barnett, M., Leino, K.R.M., Schulte, W.: The Spec\(^\sharp\) programming system: An overview. In: CASSIS, pp. 49–69 (2005)

    Google Scholar 

  3. Biering, B., Birkedal, L., Torp-Smith, N.: Bi hyperdoctrines and higher-order separation logic. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 233–247. Springer, Heidelberg (2005)

    Google Scholar 

  4. Bornat, R., Calcagno, C., O’Hearn, P.W., Parkinson, M.J.: Permission accounting in separation logic. In: Proceedings of POPL, pp. 259–270 (2005)

    Google Scholar 

  5. Bornat, R., Calcagno, C., Yang, H.: Variables as resources in separation logic. In: Proceedings of MFPS, pp. 125–146 (2005)

    Google Scholar 

  6. Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. In: FMICS, pp. 73–89 (2003)

    Google Scholar 

  7. Distefano, D., Parkinson, M.J.: jstar: towards practical verification for java. In: OOPSLA, pp. 213–226 (2008)

    Google Scholar 

  8. Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for java. In: PLDI, pp. 234–245 (2002)

    Google Scholar 

  9. Krishnaswami, N.R., Aldrich, J., Birkedal, L., Svendsen, K., Buisse, A.: Design patterns in separation logic. In: Proceedings of TLDI 2009, pp. 105–116 (2009)

    Google Scholar 

  10. Müller, P., Ruskiewicz, J.N.: A modular verification methodology for C# delegates. In: Glässer, U., Abrial, J.-R. (eds.) Rigorous Methods for Software Construction and Analysis (2007) ( to appear)

    Google Scholar 

  11. Nanevski, A., Ahmed, A., Morrisett, G., Birkedal, L.: Abstract predicates and mutable adts in hoare type theory. In: Drossopoulou, S. (ed.) ESOP 2008. LNCS, vol. 4960, pp. 189–204. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  12. Nordio, M., Calcagno, C., Meyer, B., Müller, P.: Reasoning about function objects. Technical Report 615, ETH Zurich (2009)

    Google Scholar 

  13. O’Hearn, P.W.: Resources, concurrency and local reasoning. Theor. Comput. Sci. 375(1-3), 271–307 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  14. Parkinson, M.: Local Reasoning for Java. PhD thesis, University of Cambridge (November 2005)

    Google Scholar 

  15. Parkinson, M., Bierman, G.: Separation logic, abstraction and inheritance. In: ACM Symposium on Principles of Programming Languages (POPL 2008). ACM Press, New York (January 2008)

    Google Scholar 

  16. Parkinson, M.J., Bierman, G.M.: Separation logic and abstraction. In: Proceedings of POPL, pp. 247–258 (2005)

    Google Scholar 

  17. Parkinson, M.J., Bornat, R., Calcagno, C.: Variables as resource in Hoare logic. In: Proceedings of LICS, pp. 137–146. IEEE, Los Alamitos (2006)

    Google Scholar 

  18. Petersen, R.L., Birkedal, L., Nanevski, A., Morrisett, G.: A realizability model for impredicative hoare type theory. In: Drossopoulou, S. (ed.) ESOP 2008. LNCS, vol. 4960, pp. 337–352. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  19. Schwinghammer, J., Birkedal, L., Reus, B., Yang, H.: Nested hoare triples and frame rules for higher-order store. In: Grädel, E., Kahle, R. (eds.) CSL 2009. LNCS, vol. 5771, pp. 440–454. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  20. Svendsen, K., Birkedal, L., Parkinson, M.: Verifying generics and delegates (technical appendix). Technical report (2009), http://www.itu.dk/people/kasv/generics-delegates-tr.pdf

  21. Yoshida, N., Honda, K., Berger, M.: Logical reasoning for higher-order functions with local state. In: Seidl, H. (ed.) FOSSACS 2007. LNCS, vol. 4423, pp. 361–377. Springer, Heidelberg (2007)

    Chapter  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

Svendsen, K., Birkedal, L., Parkinson, M. (2010). Verifying Generics and Delegates. In: D’Hondt, T. (eds) ECOOP 2010 – Object-Oriented Programming. ECOOP 2010. Lecture Notes in Computer Science, vol 6183. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14107-2_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-14107-2_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-14106-5

  • Online ISBN: 978-3-642-14107-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics