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.
- The Crowfoot website, 2011. www.sussex.ac.uk/informatics/crowfoot.Google Scholar
- Josh Berdine, Cristiano Calcagno, and Peter W. O'Hearn. Smallfoot: Modular automatic assertion checking with separation logic. In FMCO, pages 115--137, 2005. Google ScholarDigital Library
- Jeremy Blosser. Java tip 98: Reflect on the visitor design pattern. JavaWorld, 2000. http://www.javaworld.com/javaworld/javatips/jw-javatip98.html.Google Scholar
- 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 ScholarDigital Library
- Cristina David and Wei-Ngan Chin. Immutable specifications for more concise and precise verification. In OOPSLA, pages 359--374, 2011. Google ScholarDigital Library
- Dino Distefano and Matthew J. Parkinson. jStar: towards practical verification for Java. In OOPSLA, pages 213--226, 2008. Google ScholarDigital Library
- 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 ScholarDigital Library
- Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, MA, 1995. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- Jens Palsberg and C. Barry Jay. The essence of the visitor pattern. In COMPSAC, pages 9--15, 1998. Google ScholarDigital Library
- Matthew J. Parkinson and Gavin M. Bierman. Separation logic, abstraction and inheritance. In POPL, pages 75--86, 2008. Google ScholarDigital Library
- John C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, pages 55--74, 2002. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
Index Terms
- Verifying the reflective visitor pattern
Recommendations
Verifying executable object-oriented specifications with separation logic
ECOOP'10: Proceedings of the 24th European conference on Object-oriented programmingSpecifications of Object-Oriented programs conventionally employ Boolean expressions of the programming language for assertions. Programming errors can be discovered by checking at runtime whether an assertion, such as a precondition or class invariant, ...
Verifying higher-order functional programs with pattern-matching algebraic data types
POPL '11Type-based model checking algorithms for higher-order recursion schemes have recently emerged as a promising approach to the verification of functional programs. We introduce pattern-matching recursion schemes (PMRS) as an accurate model of computation ...
Verifying higher-order functional programs with pattern-matching algebraic data types
POPL '11: Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesType-based model checking algorithms for higher-order recursion schemes have recently emerged as a promising approach to the verification of functional programs. We introduce pattern-matching recursion schemes (PMRS) as an accurate model of computation ...
Comments