Practical Reasoning About Invocations and Implementations of Pure Methods

  • Ádám Darvas ,
  • Rustan Leino

Proceeding: FASE'07 Proceedings of the 10th international conference on Fundamental approaches to software engineering |

User-defined functions used in the specification of object-oriented programs are called pure methods. Providing sound and practical support for pure methods in a verification system faces many challenges, especially when pure methods have executable implementations and can be invoked from code at run time. This paper describes a design for reasoning about pure methods in the context of sound, modular verification. The design addresses (1) how to axiomatize pure methods as mathematical functions enabling reasoning about their result values; (2) preconditions and frame conditions for pure methods enabling reasoning about the implementation of a pure method. Two important considerations of the design are that it work with object invariants and that its logical encoding be suitable for fully automatic theorem provers. The design has been implemented in the Spec# programming system.