Skip to main content

A Graph-Based Operational Semantics of OO Programs

  • Conference paper

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

Abstract

We present a mathematical model of class graphs, object graphs and state graphs which naturally capture the essential oo features. A small-step operational semantics of oo programs is defined in the style of classical structural operational semantics, in which an execution step of a command is defined as a transition from one state graph to another obtained by simple operations on graphs. To validate this semantics, we give it an implementation in Java. This implementation can also be used for simulation and validation of oo programs, with the visualization of state graph transitions during the execution. A distinct feature of this semantics is location or address independent. Properties of objects and oo programs can be described as properties of graphs in terms of relations of navigation paths (or attribute strings).

Supported by the projects HighQSoftD, HTTS and ARV funded by Macao Science and Technology Development Fund; and grants from STCSM No. 08510700300 and CNSF No. 60970031.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abadi, M., Cardelli, L.: A Theory of Objects. Springer, Heidelberg (1996)

    MATH  Google Scholar 

  2. Baresi, L., Heckel, R., Thöne, S., Varró, D.: Style-based refinement of dynamic software architectures. In: 4th Working IEEE/IFIP Conference on Software Architecture, pp. 155–164. IEEE Computer Society, Los Alamitos (2004)

    Chapter  Google Scholar 

  3. Borba, P., Sampaio, A., Cavalcanti, A., Cornélio, M.: Algebraic reasoning for object-oriented programming. Sci. Comput. Program. 52(1-3), 53–100 (2004)

    Article  MATH  Google Scholar 

  4. Borba, P., Sampaio, A., Cornélio, M.: A refinement algebra for object-oriented programming. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 1–37. Springer, Heidelberg (2003)

    Google Scholar 

  5. Boyland, J.: Alias burying: Unique variables without destructive reads. Software Practice and Experience 31(6), 533–553 (2001)

    Article  MATH  Google Scholar 

  6. Bozga, M., Iosif, R., Lakhnech, Y.: On logics of aliasing. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 344–360. Springer, Heidelberg (2004)

    Google Scholar 

  7. Brookes, S.: A semantics for concurrent separation logic. Theor. Comput. Sci. 375(1-3), 227–270 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  8. Cavalcanti, A., Naumann, D.: A weakest precondition semantics for an object-oriented language of refinement. In: Woodcock, J.C.P., Davies, J., Wing, J.M. (eds.) FM 1999. LNCS, vol. 1709, pp. 1439–1460. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  9. Chen, Y., Sanders, J.W.: Compositional reasoning for pointer structures. In: Uustalu, T. (ed.) MPC 2006. LNCS, vol. 4014, pp. 115–139. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  10. Clarke, D., Noble, J., Potter, J.: Simple ownership types for object containment. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 53–76. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  11. Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. SIGPLAN Not. 33(10), 48–64 (1998)

    Article  Google Scholar 

  12. Corradini, A., Dotti, F.L., Foss, L., Ribeiro, L.: Translating Java code to graph transformation systems. In: Ehrig, H., Engels, G., Parisi-Presicce, F., Rozenberg, G. (eds.) ICGT 2004. LNCS, vol. 3256, pp. 383–398. Springer, Heidelberg (2004)

    Google Scholar 

  13. Corradini, A., Montanari, U., Rossi, F.: Graph processes. Fundamenta Informaticae 26(3,4), 241–265 (1996)

    MATH  MathSciNet  Google Scholar 

  14. Ehrig, H., Ehrig, K., Prange, U., Taentzer, G.: Fundamental theory for typed attributed graphs and graph transformation based on adhesive HLR categories. Fundamenta Informaticae 74(1), 31–61 (2006)

    MATH  MathSciNet  Google Scholar 

  15. Ferreira, A.P.L., Foss, L., Ribeiro, L.: Formal verification of object-oriented graph grammars specifications. ENTCS 175(4), 101–114 (2007)

    Google Scholar 

  16. Große-Rhode, M., Parisi-Presicce, F., Simeoni, M.: Spatial and temporal refinement of typed graph transformation systems. In: Brim, L., Gruska, J., Zlatuška, J. (eds.) MFCS 1998. LNCS, vol. 1450, pp. 553–561. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  17. Harwood, W., Cavalcanti, A., Woodcock, J.: A theory of pointers for the UTP. In: Fitzgerald, J.S., Haxthausen, A.E., Yenigun, H. (eds.) ICTAC 2008. LNCS, vol. 5160, pp. 141–155. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  18. He, J., Li, X., Liu, Z.: rCOS: A refinement calculus for object systems. Theor. Comput. Sci. 365(1-2), 109–142 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  19. Heckel, R., Küster, J.M., Taentzer, G.: Confluence of typed attributed graph transformation systems. In: Corradini, A., Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) ICGT 2002. LNCS, vol. 2505, pp. 161–176. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  20. Hoare, C.A.R., He, J.: A trace model for pointers and objects. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 1–17. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  21. Hoare, T., O’Hearn, P.: Separation logic semantics for communicating processes. ENTCS 212, 3–25 (2008)

    Google Scholar 

  22. Kamada, T., Kawai, S.: An algorithm for drawing general undirected graphs. Information processing letters 31(1), 7–15 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  23. Kastenberg, H., Kleppe, A., Rensink, A.: Defining object-oriented execution semantics using graph transformations. In: Gorrieri, R., Wehrheim, H. (eds.) FMOODS 2006. LNCS, vol. 4037, pp. 186–201. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  24. Ke, W., Liu, Z., Wang, S., Zhao, L.: Graph-based type system, operational semantics and implementation of an object-oriented programming language. Technical Report 410, UNU-IIST, P.O. Box 3058, Macau (2009), http://www.iist.unu.edu/www/docs/techreports/reports/report410.pdf

  25. Klein, G., Nipkow, T.: A machine-checked model for a Java-like language, virtual machine, and compiler. ACM TOPLAS 28(4), 619–695 (2006)

    Article  Google Scholar 

  26. Liu, Z., Morisset, C., Stolz, V.: rCOS: Theory and tool for component-based model driven development. Technical Report 406, UNU-IIST, P.O. Box 3058, Macau (2009), http://www.iist.unu.edu/www/docs/techreports/reports/report406.pdf (to appear in LNCS)

  27. Minsky, N.: Towards alias-free pointers. In: Cointe, P. (ed.) ECOOP 1996. LNCS, vol. 1098, pp. 189–209. Springer, Heidelberg (1996)

    Google Scholar 

  28. Naumann, D.A.: Predicate transformer semantics of a higher-order imperative language with record subtyping. Sci. Comput. Program. 41(1), 1–51 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  29. Parkinson, M., Bierman, G.: Separation logic and abstraction. SIGPLAN Not. 40(1), 247–258 (2005)

    Article  Google Scholar 

  30. Pierik, C., de Boer, F.: A syntax-directed Hoare logic for object-oriented programming concepts. In: Najm, E., Nestmann, U., Stevens, P. (eds.) FMOODS 2003. LNCS, vol. 2884, pp. 64–78. Springer, Heidelberg (2003)

    Google Scholar 

  31. Poetzsch-Heffter, A., Müller, P.: A programming logic for sequential Java. In: Swierstra, S.D. (ed.) ESOP 1999. LNCS, vol. 1576, pp. 162–176. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  32. Reynolds, J.: Separation logic: A logic for shared mutable data structures. In: Proc. 17th Annual IEEE Symposium on Logic in Computer Science. IEEE Computer Society, Los Alamitos (2002) (invited paper)

    Google Scholar 

  33. Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformation. Foundations, vol. 1. World Scientific, Singapore (1997)

    Google Scholar 

  34. van Eekelen, M., de Mol, M.: Mixed lazy/strict graph semantics. In: Proc. 16th International Workshop on Implementation and Application of Functional Languages, pp. 245–260. Christian-Albrechts-Universitaet zu Kiel (2004)

    Google Scholar 

  35. van Eekelen, M., Smetsers, S., Plasmeijer, M.: Graph rewriting semantics for functional programming languages. In: Proc. 5th Annual Conference of European Association for Computer Science Logic, pp. 106–128. Springer, Heidelberg (1996)

    Google Scholar 

  36. Wermelinger, M., Fiadero, J.L.: A graph transformation approach to software architecture reconfiguration. Sci. Comput. Program. 44(2), 133–155 (2002)

    Article  MATH  Google Scholar 

  37. Zhao, L., Liu, X., Liu, Z., Qiu, Z.: Graph transformations for object-oriented refinement. Form. Asp. Comput. 21(1-2), 103–131 (2009)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ke, W., Liu, Z., Wang, S., Zhao, L. (2009). A Graph-Based Operational Semantics of OO Programs. In: Breitman, K., Cavalcanti, A. (eds) Formal Methods and Software Engineering. ICFEM 2009. Lecture Notes in Computer Science, vol 5885. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-10373-5_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-10373-5_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-10372-8

  • Online ISBN: 978-3-642-10373-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics