Skip to main content

WP Semantics and Behavioral Subtyping

  • Conference paper
Theoretical Aspects of Computing – ICTAC 2011 (ICTAC 2011)

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

Included in the following conference series:

Abstract

For the object oriented (OO) world, developing formal semantics for theoretical study and practical use is still an important topic despite of a decade’s efforts. In this paper, for a sufficiently large subset of sequential Java with a pure reference semantics model, we define a Weakest Precondition (WP) semantics, and prove its soundness and completeness. Based on this WP semantics, we study specifications of methods and the refinement relationship between specifications, and we propose new definitions for object invariants and behavioral subtyping notation for general OO programs.

Supported by NNSF of China Grant No. 90718002.

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 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

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.

Similar content being viewed by others

References

  1. Barnett, M., DeLine, R., Fähndrich, M., Leino, K.R.M., Schulte, W., Rustan, K., Leino, M.: Verification of object-oriented programs with invariants. Journal of Object Technology 3, 2004 (2003)

    Google Scholar 

  2. Barnett, M., Leino, K.R.M., Schulte, W.: The spec# programming system: An overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  3. Barnett, M., Leino, K.R.M.: Weakest-precondition of unstructured programs. In: Proceedings of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE 2005, pp. 82–87. ACM, New York (2005)

    Google Scholar 

  4. Burdy, L., Requet, A., Lanet, J.-L.: Java applet correctness: A developer-oriented approach. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 422–439. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  5. Cavalcanti, A.L.C., Naumann, D.: A weakest precondition semantics for refinement of object-oriented programs. IEEE Trans. on Software Engineering 26(8), 713–728 (2000)

    Article  Google Scholar 

  6. de Boer, F.S.: A WP-calculus for OO. In: Thomas, W. (ed.) FOSSACS 1999. LNCS, vol. 1578, pp. 135–149. Springer, Heidelberg (1999), http://dx.doi.org/10.1007/3-540-49019-1_10

    Chapter  Google Scholar 

  7. Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for java. SIGPLAN Not. 37, 234–245 (2002)

    Article  Google Scholar 

  8. Hesselink, W.H.: Predicate-transformer semantics of general recursion. Acta Informatica 26, 309–332 (1989)

    MathSciNet  MATH  Google Scholar 

  9. Hoare, C.A.R.: Proof of correctness of data representations. Acta Informatica 1, 271–281 (1972)

    Article  MATH  Google Scholar 

  10. Jacobs, B.: Weakest precondition reasoning for java programs with jml annotations. Journal of Logic and Algebraic Programming 58, 2004 (2002)

    Google Scholar 

  11. Jifeng, H., Li, X., Liu, Z.: rcos: a refinement calculus of object systems. Theor. Comput. Sci. 365, 109–142 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  12. Leavens, G.T., Naumann, D.A.: Behavioral subtyping is equivalent to modular reasoning for object-oriented programs. Technical Report 06-36, Department of Computer Science, Iowa State University, Ames, Iowa, 50011 (December 2006)

    Google Scholar 

  13. Leavens, G.T., Naumann, D.A.: Behavioral subtyping, specification inheritance, and modular reasoning. Technical Report 06-20b, Department of Computer Science, Iowa State University, Ames, Iowa, 50011 (September 2006)

    Google Scholar 

  14. Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: A behavioral interface specification language for Java. SIGSOFT Software Engineering Notes 31(3), 1–38 (2006)

    Article  Google Scholar 

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

    Chapter  Google Scholar 

  16. Liskov, B.: Keynote address - data abstraction and hierarchy. In: Addendum to the Proceedings on Object-Oriented Programming Systems, Languages and Applications (Addendum), OOPSLA 1987, pp. 17–34. ACM, New York (1987)

    Google Scholar 

  17. Liskov, B., Wing, J.M.: A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16(6), 1811–1841 (1994)

    Article  Google Scholar 

  18. Müller, P.: Modular Specification and Verification of Object-Oriented Programs. LNCS, vol. 2262. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  19. Noble, J., Vitek, J., Potter, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  20. Parkinson, M., Summers, A.: The relationship between separation logic and implicit dynamic frames. In: Barthe, G. (ed.) ESOP 2011. LNCS, vol. 6602, pp. 439–458. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  21. Parkinson, M.J., Bierman, G.M.: Separation logic, abstraction and inheritance. In: Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, pp. 75–86. ACM, New York (2008)

    Google Scholar 

  22. Pierik, C., de Boer, F.S.: A proof outline logic for object-oriented programming. Theor. Comput. Sci. 343(3), 413–442 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  23. Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: Symposium on Logic in Computer Science, pp. 55–74. IEEE Computer Society, Los Alamitos (2002)

    Google Scholar 

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

    Chapter  Google Scholar 

  25. Liu, Y., Qiu, Z.: A separation logic for OO programs. Technical Report 2010-42, School of Math., Peking University (2010) (preprints), http://www.mathinst.pku.edu.cn/index.php?styleid=2

  26. Liu, Y., Qiu, Z., Long, Q.: A weakest precondition semantics for Java. Technical Report 2010-46, School of Math., Peking University (2010) (preprints), http://www.mathinst.pku.edu.cn/index.php?styleid=2

  27. Qiu, Z., Wang, S., Long, Q.: Sequential μJava: Formal foundations. Technical Report 2007-35, School of Math., Peking University (2007) (preprints), http://www.mathinst.pku.edu.cn/index.php?styleid=2

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Liu, Y., Qiu, Z., Long, Q. (2011). WP Semantics and Behavioral Subtyping. In: Cerone, A., Pihlajasaari, P. (eds) Theoretical Aspects of Computing – ICTAC 2011. ICTAC 2011. Lecture Notes in Computer Science, vol 6916. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-23283-1_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-23283-1_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-23282-4

  • Online ISBN: 978-3-642-23283-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics