Verifying traits: a proof system for fine-grained reuse
Verifying traits: a proof system for fine-grained reuse
复制标题
验证特征:细粒度重用的证明系统
DOI:
--
复制
发表时间:
2011
期刊:
影响因子:
--
通讯作者:
Ina Schaefer
中科院分区:
文献类型:
--
作者:
Ferruccio Damiani;Johan Dovland;E. Johnsen;Ina Schaefer
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.