Algebraic reasoning for object-oriented programming

  • Authors:
  • Paulo Borba;Augusto Sampaio;Ana Cavalcanti;Márcio Cornélio

  • Affiliations:
  • Informatics Center, Federal University of Pernambuco, Recife, 50740-540, Brazil;Informatics Center, Federal University of Pernambuco, Recife, 50740-540, Brazil;Computing Laboratory University of Kent Canterbury CT2 7NF, UK;Polytechnic School, University of Pernambuco, Recife 50750-410, Brazil and Informatics Center, Federal University of Pernambuco, Recife, 50740-540, Brazil

  • Venue:
  • Science of Computer Programming - Special issue on program transformation
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present algebraic laws for a language similar to a subset of sequential Java that includes inheritance, recursive classes, dynamic binding, access control, type tests and casts, assignment, but no sharing. These laws are proved sound with respect to a weakest precondition semantics. We also show that they are complete in the sense that they are sufficient to reduce an arbitrary program to a normal form substantially close to an imperative program; the remaining object-oriented constructs could be further eliminated if our language had recursive records. This suggests that our laws are expressive enough to formally derive behaviour preserving program transformations, we illustrate that through the derivation of provably-correct refactorings.