Abstract
A semantics-based framework is presented for the definition and manipulation of class hierarchies for object-oriented languages. The framework is based on the notion of observable of a class, i.e., an abstraction of its semantics when focusing on a behavioral property of interest. We define a semantic subclass relation, capturing the fact that a subclass preserves the behavior of its superclass up to a given (tunable) observed property. We study the relation between syntactic subclass, as present in mainstream object-oriented languages, and the notion of semantic subclass. The approach is then extended to class hierarchies, leading to a semantics-based modular treatment of a suite of basic observable-preserving operators on hierarchies. We instantiate the framework by presenting effective algorithms that compute a semantic superclass for two given classes, that extend a hierarchy with a new class, and that merge two hierarchies by preserving semantic subclass relations.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bracha, G., Cook, W.R.: Mixin-based inheritance. In: 5th ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 1990). SIGPLAN Notices, vol. 25(10), pp. 303–311 (1990)
Cardelli, L.: A semantics of multiple inheritance. In: Plotkin, G., MacQueen, D.B., Kahn, G. (eds.) Semantics of Data Types 1984. LNCS, vol. 173, pp. 51–67. Springer, Heidelberg (1984); Full version in Information and Computation, 76(2/3),138–164 (1988)
Castagna, G.: Covariance and contravariance: conflict without a cause. ACM Transactions on Programming Languages and Systems 17(3), 431–447 (1995)
Cook, W.R., Hill, W., Canning, P.S.: Inheritance is not subtyping. In: Proceedings of the 17th annual ACM SIGPLAN-SIGACT Symposium on Principles of programming languages (POPL 1990), January 1990. ACM Press, New York (1990)
Cook, W.R., Palsberg, J.: A denotational semantics of inheritance and its correctness. Information and Computation 114(2), 329–350 (1994)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stei, C.: Introduction to Algorithms, 2nd edn. The MIT Press and McGraw-Hill Book Company (2001)
Cortesi, A., Logozzo, F.: Abstract interpretation-based verification of non functional requirements. In: Jajodia, S., Wijesekera, D. (eds.) Data and Applications Security 2005. LNCS, vol. 3654, pp. 49–62. Springer, Heidelberg (2005)
Cousot, P.: Methods and logics for proving programs. In: van Leeuwen, J. (ed.) Formal Models and Semantics. Handbook of Theoretical Computer Science, vol. B, ch.15, pp. 843–993. Elsevier Science, Amsterdam (1990)
Cousot, P.: Types as abstract interpretations, invited paper. In: 24th ACM Symposium on Principles of Programming Languages (POPL ’97), January 1997, pp. 316–331. ACM Press, New York (1997)
Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: 4th ACM Symposium on Principles of Programming Languages (POPL 1977), January 1977, pp. 238–252. ACM Press, New York (1977)
Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: 6th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 1979), pp. 269–282. ACM Press, New York (1979)
Cousot, P., Cousot, R.: Systematic design of program transformation frameworks by abstract interpretation. In: 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2002), January 2002, pp. 178–190. ACM Press, New York (2002)
Dahl, O., Nygaard, K.: SIMULA - an ALGOL-based simulation language. Communications of the ACM (CACM) 9(9), 671–678 (1966)
Detlefs, D.L., Rustan, K., Leino, M., Nelson, G., Saxe J.B.: Extended static checking. Research Report #159, Compaq Systems Research Center, Palo Alto, USA (December 1998)
Goldberg, A., Robson, D.: Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading (1983)
Granger, P.: Static analysis of linear congruence equalities among variables of a program. In: Dassow, J., Kelemen, J. (eds.) IMYCS 1990. LNCS, vol. 464, pp. 169–192. Springer, Heidelberg (1990)
Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary Design of JML: A Behavioral Interface Specification Language for Java (November 2003)
Liskov, B.H., Wing, J.M.: A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems 16(6), 1811–1841 (1994)
Logozzo, F.: Class-level modular analysis for object oriented languages. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 37–54. Springer, Heidelberg (2003)
Logozzo, F.: An approach to behavioral subtyping based on static analysis. In: Proceedings of the International Workshop on Test and Analysis of Component Based Systems (TACoS 2004), April 2004. Electronic Notes in Theoretical Computer Science. Elsevier Science, Amsterdam (2004)
Logozzo, F.: Automatic inference of class invariants. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 211–222. Springer, Heidelberg (2004)
Logozzo, F.: Modular Static Analysis of Object-oriented languges. PhD thesis, École Polytecnique (2004)
Logozzo, F.: Class invariants as abstract interpretation of trace semantics. Computer Languages, Systems and Structures (2005) (to appear)
Logozzo, F., Cortesi, A.: Semantic class hierarchies by abstract intepretation. Technical Report CS-2004-7, Dipartimento di Informatica, Università Ca’ Foscari di Venezia, Italy (2004)
Meyer, B.: Object-Oriented Software Construction, 2nd edn. Professional Technical Reference. Prentice Hall, Englewood Cliffs (1997)
Miné, A.: The octagon abstract domain. In: AST 2001 in WCRE 2001, October 2001, pp. 310–319. IEEE CS Press, Los Alamitos (2001)
NetBeans.org and Sun Mycrosystem, Inc. Netbeans IDE (2004)
Odifreddi, P.: Classical Recursion Theory. Elsevier, Amsterdam (1999)
Palsberg, J., Schwartzbach, M.I.: Object-Oriented Type Systems. John Wiley & Sons, Chichester (1994)
Pollet, I., Le Charlier, B., Cortesi, A.: Distinctness and sharing domains for static analysis of Java programs. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 77–98. Springer, Heidelberg (2001)
Sagiv, S., Reps, T.W., Wilhelm, R.: Parametric shape analysis via 3-valued logic. ACM Transactions on Programming Languages and Systems 24(3), 217–288 (2002)
Snelting, G., Tip, F.: Semantics-based composition of class hierarchies. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 562–584. Springer, Heidelberg (2002)
Streckenbach, M., Snelting, G.: Refactoring class hierarchies with KABA. In: Proceedings of the 19th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2004). ACM Press, New York (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Logozzo, F., Cortesi, A. (2005). Semantic Hierarchy Refactoring by Abstract Interpretation. In: Emerson, E.A., Namjoshi, K.S. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2006. Lecture Notes in Computer Science, vol 3855. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11609773_21
Download citation
DOI: https://doi.org/10.1007/11609773_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-31139-3
Online ISBN: 978-3-540-31622-0
eBook Packages: Computer ScienceComputer Science (R0)