Abstract
The use of executable assertions is widely recognised as a useful programming technique for complex systems. In many cases static analysis of programs allows such assertions to be removed at compile time, thus removing the overhead of the test. The use of interprocedural analysis would often allow a larger number of such tests to be statically removed; intermodular analysis could even improve overall safety of the system. In general, however, such analysis is antithetical to separate compilation and extensible systems.
In this paper we offer a partial solution to this dilemma: We propose that preconditions become part of the interface definition of an encapsulated object. The implementation consequences of this technique are explored.
Preview
Unable to display preview. Download preview PDF.
References
Diane Corney and John Gough. Type test elimination using typeflow analysis. In Jürg Gutknecht, editor, Proceedings Int. Confr. Programming Languages and System Architectures, volume 782 of Lecture Notes in Computer Science, pages 137–150. Springer Verlag, 1994.
Régis Crelier. Separate Compilation and Module Extension. PhD thesis, Swiss Federal Institute of Technology, Zürich, Switzerland, 1994. Diss. ETH No. 10650.
K John Gough and Herbert Klaeren. Eliminating range checks using static single assignment form. In Proceedings ACSC19, Melbourne, Australia. Australian Computer Science Society, 1996.
Rajiv Gupta. A fresh look at optimizing array bound checking. In Proc. ACM SIGPLAN'90 Confr. Programming Language Design and Implementation, volume 25(6) of SIGPLAN Notices, pages 272–282, 1990.
Rajiv Gupta. Optimizing array bound checks using flow analysis. ACM Letters on Programming Languages and Systems, 2(1–4):135–150, 1993.
ISO. Information Technology — Programming Languages — Modula-2. IS 10154-1. International Standards Organisation, June 1996.
Victoria Markstein, John Cocke, and Peter Markstein. Optimization of range checking. In Proc. of ACM '82 Symposium on Compiler Construction, pages 114–119, 1982.
Bertrand Meyer. Eiffel: The Language. Englewood Cliffs, 1991.
Bertrand Meyer. Applying “Design by Contract”. IEEE Computer, 25(10):40–51, 1992.
QUT. Gardens Point Modula Home Page. http://www.fit.qut.edu.au/CompSci/PLAS/GPM. Information on gardens point compilers, their availability, and documentation.
Rob Strom. Do programmers need seat belts? SIGPLAN Notices, 31(3):6–7, 1996.
N. Wirth and C. A. R. Hoare. A contribution to the development of Algol. Communications of the ACM, 9:413–431, 1966.
Niklaus Wirth. Programming in Modula-2. Springer, 3rd edition, 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gough, K.J., Klaeren, H. (1997). Executable assertions and separate compilation. In: Mössenböck, H. (eds) Modular Programming Languages. JMLC 1997. Lecture Notes in Computer Science, vol 1204. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62599-2_29
Download citation
DOI: https://doi.org/10.1007/3-540-62599-2_29
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-62599-5
Online ISBN: 978-3-540-68328-5
eBook Packages: Springer Book Archive