skip to main content
10.1145/2318202.2318208acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Verifying the reflective visitor pattern

Published:12 June 2012Publication History

ABSTRACT

Computational reflection allows a program to inspect and manipulate the structure or behaviour of itself at runtime. Often this means that it is possible to create more generic or adaptable programs in an elegant way. However, there is little support for specification and automatic verification of reflective programs. We address this problem by implementing, specifying, and verifying a reflective library using a Hoare-logic for a simple language with stored procedures. The latter is important since reflective metadata is modelled on the heap, thus method objects will be realised as stored procedures. We verify memory safety as well as functional correctness of an instance of the reflective visitor pattern, including the reflective library. The entire verification is carried out in our (semi-)automatic verification tool Crowfoot.

References

  1. The Crowfoot website, 2011. www.sussex.ac.uk/informatics/crowfoot.Google ScholarGoogle Scholar
  2. Josh Berdine, Cristiano Calcagno, and Peter W. O'Hearn. Smallfoot: Modular automatic assertion checking with separation logic. In FMCO, pages 115--137, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jeremy Blosser. Java tip 98: Reflect on the visitor design pattern. JavaWorld, 2000. http://www.javaworld.com/javaworld/javatips/jw-javatip98.html.Google ScholarGoogle Scholar
  4. Nathaniel Charlton, Ben Horsfall, and Bernhard Reus. Crowfoot: A verifier for higher-order store programs. In VMCAI, volume 7148 of Lecture Notes in Computer Science, pages 136--151. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Cristina David and Wei-Ngan Chin. Immutable specifications for more concise and precise verification. In OOPSLA, pages 359--374, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Dino Distefano and Matthew J. Parkinson. jStar: towards practical verification for Java. In OOPSLA, pages 213--226, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended static checking for Java. In PLDI, pages 234--245, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, MA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Christopher M. Hayden, Stephen Magill, Michael Hicks, Nate Foster, and Jeffrey S. Foster. Specifying and verifying the correctness of dynamic software updates. In Proceedings of the International Conference on Verified Software: Theories, Tools, and Experiments (VSTTE), January 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bart Jacobs, Jan Smans, Pieter Philippaerts, Frédéric Vogels, Willem Penninckx, and Frank Piessens. VeriFast: A powerful, sound, predictable, fast verifier for C and Java. In NASA Formal Methods, pages 41--55, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Gary Leavens, Erik Poll, Curtis Clifton, Yoonsik Cheon, Clyde Ruby, David Cok, Peter Müller, Joseph Kiniry, Patrice Chalin, Daniel Zimmerman, and Werner Dietl. JML reference manual (draft v1.235). Department of Computer Science, Iowa State University. Available from http://www.jmlspecs.org, July 2008.Google ScholarGoogle Scholar
  12. Jens Palsberg and C. Barry Jay. The essence of the visitor pattern. In COMPSAC, pages 9--15, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Matthew J. Parkinson and Gavin M. Bierman. Separation logic, abstraction and inheritance. In POPL, pages 75--86, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, pages 55--74, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Jan Schwinghammer, Lars Birkedal, Bernhard Reus, and Hongseok Yang. Nested Hoare triples and frame rules for higher-order store. In CSL, pages 440--454, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Jan Schwinghammer, Lars Birkedal, Bernhard Reus, and Hongseok Yang. Nested Hoare triples and frame rule for higher-order store. Logical Methods in Computer Science, 7(3), September 2011.Google ScholarGoogle Scholar

Index Terms

  1. Verifying the reflective visitor pattern

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              cover image ACM Other conferences
              FTfJP '12: Proceedings of the 14th Workshop on Formal Techniques for Java-like Programs
              June 2012
              53 pages
              ISBN:9781450312721
              DOI:10.1145/2318202

              Copyright © 2012 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 12 June 2012

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate51of75submissions,68%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader