skip to main content
10.1145/2076674.2076682acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Verifying traits: a proof system for fine-grained reuse

Published: 25 July 2011 Publication History

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.

References

[1]
E. Allen, D. Chase, J. Hallett, V. Luchangco, G.-W.Maessen, S. Ryu, G. Steele, and S. Tobin-Hochstad. The Fortress Language Specification, V. 1.0, 2008.
[2]
P. America. Designing an object-oriented programming language with behavioural subtyping. In J. W. de Bakker, W.-P. de Roever, and G. Rozenberg, editors, Foundations of Object-Oriented Languages, pages 60--90. Springer, 1991.
[3]
K. R. Apt. Ten years of Hoare's logic: A survey --- Part I. ACM Transactions on Programming Languages and Systems, 3(4):431--483, Oct. 1981.
[4]
K. R. Apt, F. S. de Boer, and E.-R. Olderog. Verification of Sequential and Concurrent Systems. Texts and Monographs in Computer Science. Springer, 3rd edition, 2009.
[5]
B. Beckert, R. Hähnle, and P. H. Schmitt, editors. Verification of Object-Oriented Software: The KeY Approach, volume 4334 of LNCS. Springer, 2007.
[6]
L. Bettini, F. Damiani, and I. Schaefer. Implementing software product lines using traits. In SAC, pages 2096--2102. ACM, 2010.
[7]
L. Bettini, F. Damiani, and I. Schaefer. Implementing Type-Safe Software Product Lines using Records and Traits. Technical Report RT 135, Dipartimento di Informatica, Università di Torino, 2011. Available at http://www.di.unito.it/~damiani/papers/tr-135-2011.pdf.
[8]
L. Bettini, F. Damiani, I. Schaefer, and F. Strocco. A prototypical Java-like language with records and traits. In PPPJ, pages 129--138. ACM, 2010.
[9]
V. Bono, F. Damiani, and E. Giachino. On Traits and Types in a Java-like setting. In TCS (Track B), volume 273 of IFIP, pages 367--382. Springer, 2008.
[10]
G. Booch, J. Rumbaugh, and I. Jacobson. The Unified Modeling Language User Guide. Addison-Wesley, 1999.
[11]
F. Damiani, J. Dovland, E. B. Johnsen, and I. Schaefer. A Proof System for Fine-Grained Reuse (version with Appendix). Technical Report RT 140, Dip. di Informatica, Università di Torino, 2011. Available at http://www.di.unito.it/~damiani/papers/tr-140-2011.pdf.
[12]
F. S. de Boer. A WP-calculus for OO. In W. Thomas, editor, Proceedings of Foundations of Software Science and Computation Structure, (FOSSACS'99), volume 1578 of LNCS, pages 135--149. Springer, 1999.
[13]
J. Dovland, E. B. Johnsen, O. Owe, and M. Steffen. Lazy behavioral subtyping. Journal of Logic and Algebraic Programming, 79(7):578--607, 2010.
[14]
J. Dovland, E. B. Johnsen, O. Owe, and M. Steffen. Incremental reasoning with lazy behavioral subtyping for multiple inheritance. Science of Computer Programming, 76(10):915--941, 2011.
[15]
S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, and A. P. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems, 28(2):331--388, 2006.
[16]
C. A. R. Hoare. An Axiomatic Basis of Computer Programming. Communications of the ACM, 12:576--580, 1969.
[17]
A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396--450, 2001.
[18]
E. B. Johnsen, O. Owe, and I. C. Yu. Creol: A type-safe object-oriented model for distributed concurrent systems. Theoretical Computer Science, 365(1--2):23--66, Nov. 2006.
[19]
G. T. Leavens and D. A. Naumann. Behavioral subtyping, specification inheritance, and modular reasoning. Technical Report 06--20a, Department of Computer Science, Iowa State University, Ames, Iowa, 2006.
[20]
L. Liquori and A. Spiwack. Extending FeatherTrait Java with interfaces. Theoretical Computer Science, 398(1-3):243--260, 2008.
[21]
B. H. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems, 16(6):1811--1841, Nov. 1994.
[22]
C. Luo and S. Qin. Separation logic for multiple inheritance. ENTCS, 212:27--40, April 2008.
[23]
O. Nierstrasz, S. Ducasse, and N. Schärli. Flattening traits. JOT, 5(4):129--148, 2006.
[24]
M. Nordio, C. Calcagno, P. Müller, and B. Meyer. A Sound and Complete Program Logic for Eiffel. In M. Oriol, editor, TOOLS-EUROPE 2009, volume 33 of Lecture Notes in Business and Information Processing, pages 195--214, 2009.
[25]
M. Odersky. The Scala Language Specification, version 2.4. Technical report, Programming Methods Laboratory, EPFL, 2007.
[26]
S. Owicki and D. Gries. An axiomatic proof technique for parallel programs I. Acta Informatica, 6(4):319--340, 1976.
[27]
A. Poetzsch-Heffter and P. Müller. A programming logic for sequential Java. In S. D. Swierstra, editor, 8th European Symposium on Programming Languages and Systems (ESOP'99), volume 1576 of LNCS, pages 162--176. Springer, 1999.
[28]
J. Reppy and A. Turon. A foundation for trait-based metaprogramming. In Electronic proceedings of FOOL/WOOD 2006, 2006.
[29]
J. Reppy and A. Turon. Metaprogramming with traits. In ECOOP, volume 4609 of LNCS, pages 373--398. Springer, 2007.
[30]
M. Schwerhoff. Verifying Scala traits. Semester Report, Swiss Federal Institute of Technology Zurich (ETH), Oct. 2010.
[31]
C. Smith and S. Drossopoulou. Chai: Traits for Java-like languages. In ECOOP, volume 3586 of LNCS, pages 453--478. Springer, 2005.
[32]
S. van Staden and C. Calcagno. Reasoning about multiple related abstractions with multistar. In OOPSLA '10, pages 504--519. ACM, 2010.

Cited By

View all
  • (2017)Embedding Verification Concerns in Self-Adaptive System Code2017 IEEE 11th International Conference on Self-Adaptive and Self-Organizing Systems (SASO)10.1109/SASO.2017.21(121-130)Online publication date: Sep-2017
  • (2014)Verified Subtyping with Traits and MixinsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.156.8156(45-51)Online publication date: 8-Jul-2014
  • (2014)Generic traits for the Java platformProceedings of the 2014 International Conference on Principles and Practices of Programming on the Java platform: Virtual machines, Languages, and Tools10.1145/2647508.2647518(5-16)Online publication date: 23-Sep-2014
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
FTfJP '11: Proceedings of the 13th Workshop on Formal Techniques for Java-Like Programs
July 2011
85 pages
ISBN:9781450308939
DOI:10.1145/2076674
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]

Sponsors

  • Lancaster University: Lancaster University
  • AITO: Assoc Internationale por les Technologies Objects

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 July 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. incremental reasoning
  2. program verification
  3. proof system
  4. trait

Qualifiers

  • Research-article

Funding Sources

Conference

ECOOP '11
Sponsor:
  • Lancaster University
  • AITO
ECOOP '11: European Conference on Object-Oriented Programming
July 25 - 29, 2011
Lancaster, United Kingdom

Acceptance Rates

Overall Acceptance Rate 51 of 75 submissions, 68%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2017)Embedding Verification Concerns in Self-Adaptive System Code2017 IEEE 11th International Conference on Self-Adaptive and Self-Organizing Systems (SASO)10.1109/SASO.2017.21(121-130)Online publication date: Sep-2017
  • (2014)Verified Subtyping with Traits and MixinsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.156.8156(45-51)Online publication date: 8-Jul-2014
  • (2014)Generic traits for the Java platformProceedings of the 2014 International Conference on Principles and Practices of Programming on the Java platform: Virtual machines, Languages, and Tools10.1145/2647508.2647518(5-16)Online publication date: 23-Sep-2014
  • (2013)Pure trait-based programming on the Java platformProceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools10.1145/2500828.2500835(67-78)Online publication date: 11-Sep-2013
  • (2013)Verifying traits: an incremental proof system for fine-grained reuseFormal Aspects of Computing10.1007/s00165-013-0278-326:4(761-793)Online publication date: 17-May-2013
  • (2012)A liskov principle for delta-oriented programmingProceedings of the 5th international conference on Leveraging Applications of Formal Methods, Verification and Validation: technologies for mastering change - Volume Part I10.1007/978-3-642-34026-0_4(32-46)Online publication date: 15-Oct-2012
  • (2012)Tracking behavioral constraints during object-oriented software evolutionProceedings of the 5th international conference on Leveraging Applications of Formal Methods, Verification and Validation: technologies for mastering change - Volume Part I10.1007/978-3-642-34026-0_19(253-268)Online publication date: 15-Oct-2012

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media