Abstract

We present a generic framework for the automatic and modular inference of sound class invariants for class-based object-oriented languages. We define a trace-based semantics for classes which considers all possible orderings, with all possible arguments, of invocations of all the methods of a class. We prove a correspondence theorem between such a semantics and a generic, trace-based, semantics for complete object-oriented programs. We express state-based class invariants in a fixpoint form by considering an abstraction of the class semantics, and we show how class invariants can be automatically inferred exploiting a static analysis of the methods. Furthermore, we address the problem of inferring a subclass invariant without accessing to the parent code, but just to its invariant.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call