Abstract
In this article we introduce a comprehensive set of algebraic laws for ROOL, a language similar to sequential Java but with a copy semantics. We present a few laws of commands, but focus on the object-oriented features of the language. We show that this set of laws is complete in the sense that it is sufficient to reduce an arbitrary ROOL program to a normal form expressed in a restricted subset of the ROOL operators. We also propose a law for data refinement that generalises the technique from traditional modules to class hierarchies. Together, these laws are expressive enough to derive more elaborate rules that can be useful, for example, to formalize object-oriented design practices; this is illustrated through the systematic derivation of a refactoring from the proposed laws.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Hoare, C.A.R., et al.: Laws of programming. Communications of the ACM 30, 672–686 (1987)
Morgan, C.: Programming from Specifications, 2nd edn. Prentice-Hall, Englewood Cliffs (1994)
Sampaio, A.: An Algebraic Approach to Compiler Design. Algebraic Methodology and Software Technology, vol. 4. World Scientific, Singapore (1997)
Roscoe, A., Hoare, C.A.R.: The laws of occam programming. Theoretical Computer Science 60, 177–229 (1988)
Bird, R., de Moor, O.: Algebra of Programming. Prentice-Hall, Englewood Cliffs (1997)
Seres, S., Spivey, M., Hoare, T.: Algebra of logic programming. In: ICPL 1999, New Mexico, USA (1999)
Hoare, C., Jifeng, H.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)
Fowler, M.: Refactoring—Improving the design of existing code. Addison-Wesley, Reading (1999)
Lea, D.: Concurrent Programming in Java. Addison-Wesley, Reading (1997)
Opdyke, W.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign (1992)
Roberts, D.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana Champaign (1999)
Mikhajlova, A., Sekerinsk, E.: Class refinement and interface refinement in object-oriented programs. In: Fitzgerald, J.S., Jones, C.B., Lucas, P. (eds.) FME 1997. LNCS, vol. 1313, pp. 82–101. Springer, Heidelberg (1997)
Leino, K.R.M.: Recursive Object Types in a Logic of Object-oriented Programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, p. 170. Springer, Heidelberg (1998)
Evans, A.: Reasoning with UML class diagrams. In: Workshop on Industrial Strength Formal Methods, WIFT 1998, Florida, USA. IEEE Press, Los Alamitos (1998)
Evans, A., France, R., Lano, K., Rumpe, B.: The UML as a formal modeling notation. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 336–348. Springer, Heidelberg (1999)
Lano, K., Bicarregui, J.: Semantics and transformations for UML models. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 107–119. Springer, Heidelberg (1999)
Gogolla, M., Richters, M.: Transformation rules for UML class diagrams. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 92–106. Springer, Heidelberg (1999)
Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modelling Language User Guide. Addison-Wesley, Reading (1999)
Cavalcanti, A., Naumann, D.: A weakest precondition semantics for an objectoriented language of refinement. In: Woodcock, J.C.P., Davies, J., Wing, J.M. (eds.) FM 1999. LNCS, vol. 1709, pp. 1439–1459. Springer, Heidelberg (1999)
Cavalcanti, A., Naumann, D.: A weakest precondition semantics for refinement of object-oriented programs. IEEE Transactions on Software Enginnering 26, 713–728 (2000)
Arnold, K., Gosling, J.: The Java Programming Language. Addison Wesley, Reading (1996)
Gosling, J., Joy, B., Steele, G.: The Java Language Specification. Addison-Wesley, Reading (1996)
Cornélio, M. L.: Applying Object-oriented Refactoring and Patterns as Formal Refinements. PhD thesis, Informatics Center, Federal University of Pernambuco, Brazil (to appear in 2003)
Lira, B.O.: Automação de Regras para Programação Orientada a Objetos. Master’s thesis, Centro de Informática, Universidade Federal de Pernambuco, Brazil (2002)
Meseguer, J.: A logical theory of concurrent objects and its realization in the Maude language. In: Agha, G., Wegner, P., Yonezawa, A. (eds.) Object-Oriented Programming, pp. 314–390. MIT Press, Cambridge (1993)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Borba, P., Sampaio, A., Cornélio, M. (2003). A Refinement Algebra for Object-Oriented Programming. In: Cardelli, L. (eds) ECOOP 2003 – Object-Oriented Programming. ECOOP 2003. Lecture Notes in Computer Science, vol 2743. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45070-2_20
Download citation
DOI: https://doi.org/10.1007/978-3-540-45070-2_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40531-3
Online ISBN: 978-3-540-45070-2
eBook Packages: Springer Book Archive