Verifying traits: a proof system for fine-grained reuse

  • Authors:
  • Ferruccio Damiani;Johan Dovland;Einar Broch Johnsen;Ina Schaefer

  • Affiliations:
  • Università di Torino, Italy;University of Oslo, Norway;University of Oslo, Norway;Technische Universität, Braunschweig, Germany

  • Venue:
  • Proceedings of the 13th Workshop on Formal Techniques for Java-Like Programs
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Traits have been proposed as a more flexible mechanism for code structuring in object-oriented programming than class inheritance, for achieving fine-grained code reuse. A trait originally developed for one purpose can be modified and reused in a completely different context. Formalizations of traits have been extensively studied, and implementations of traits have started to appear in programming languages. However, work on formally establishing properties of trait-based programs has so far mostly concentrated on type systems. This paper proposes the first deductive proof system for a trait-based object-oriented language. If a specification for a trait can be given a priori, covering all actual usage of that trait, our proof system is modular as each trait is analyzed only once. In order to reflect the flexible reuse potential of traits, our proof system additionally allows new specifications to be added to a trait in an incremental way which does not violate established proofs. We formalize and show the soundness of the proof system.