Abstract
Dimensional safety policy checking is an old topic in software analysis concerned with ensuring that programs do not violate basic principles of units of measurement. Scientific and/or navigation software is routinely dimensional and violations of measurement unit safety policies can hide significant domain-specific errors which are hard or impossible to find otherwise. Dimensional analysis of programs written in conventional programming languages is addressed in this paper. We draw general design principles for dimensional analysis tools and then discuss our prototypes, implemented by rewriting, which include both dynamic and static checkers. Our approach is based on assume/assert annotations of code which are properly interpreted by our tools and ignored by standard compilers/interpreters. The output of our prototypes consists of warnings that list those expressions violating the unit safety policy. These prototypes are implemented in the rewriting system Maude.
This work is supported by joint NSF/NASA grant CCR-0234524.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
GNU BC. URL: http://www.gnu.org/software/bc/bc.html.
J. Bergstra and J.V. Tucker. Equational specifications, complete rewriting systems, and computable and semicomputable algebras. JACM, 42(6):1194–1230, 1995.
P. Borovanský, H. Cîrstea, H. Dubois, C. Kirchner, H. Kirchner, P.-E. Moreau, C. Ringeissen, and M. Vittek. ELAN. User manual — http://www.loria.fr.
M. Broy, M. Wirsing, and P. Pepper. On the algebraic definition of programming languages. ACM Trans. on Prog. Lang. and Systems, 9(1):54–99, January 1987.
T. Cheatham. Handling fractions and n-tuples in algebraic languages. Presented at the 15th ACM Annual Meeting, Aug. 1960.
M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí-Oliet, J. Meseguer, and J. Quesada. Maude: spec. and progr. in rewriting logic. J. of TCS, 285(2):187–243, 2002.
Compaq. ESC for Java, 2000. URL: http://www.research.compaq.com/SRC/esc.
R. Diaconescu and K. Futatsugi. CafeOBJ Report: The Language, Proof Techniques, and Methodologies for Object-Oriented Algebraic Specification. World Scientific, 1998. AMAST Series in Computing, volume 6.
A. Dreiheller, M. Moerschbacher, and B. Mohr. Physcal — programming Pascal with physical units. ACM SIGPLAN Notices, 21(12):114–123, December 1986.
N. Gehani. Units of measure as a data attribute. Comp. Lang., 2:93–111, 1977.
N. H. Gehani. Ada’s derived types and units of measure. Software: Practice and Experience, 15(6):555–569, June 1985.
J. Goguen and G. Malcolm. Alg. Semantics of Imperative Programs. MIT, 1996.
J. Goguen, T. Winkler, J. Meseguer, K. Futatsugi, and J.-P. Jouannaud. Introducing OBJ. In Software Eng. with OBJ: Alg. spec. in action. Kluwer, 2000.
I. J. Hayes and B. P. Mahony. Units of measurement in formal specifications. Technical report, SVR Centre, University of Queensland, November 1994.
P. N. Hilfinger. An Ada package for dimensional analysis. ACM Transactions on Programming Languages and Systems, 10(2):189–203, April 1988.
R. T. House. A proposal for the extended form of type checking of expressions. The Computer Journal, 26(4):366–374, 1983.
M. Karr and D. B. Loveman III. Incorporation of units into programming languages. Communications of the ACM, 21(5):385–391, May 1978.
A. J. Kennedy. Relational parametricity and units of measure. In POPL’97. ACM.
A. J. Kennedy. Programming Languages and Dimensions. PhD thesis, St. Catherine’s College, University of Cambridge, November 1995.
G. W. Macpherson. A reusable ada package for scientific dimensional integrity. ACM Ada Letters, XVI(3):56–69, 1996.
R. Milner. A theory of type polymorphism in programming languages. Journal of Computer and System Sciences, 17:348–375, 1978.
Peter G. Neumann. Letter from the editor — risks to the public. ACM SIGSOFT Software Engineering Notes, 10(3):10, July 1985.
M. Odersky and K. Läufer. Putting type annotations to work. TR, Newton Institute Workshop on Advances in Type Systems for Comp., Cambridge, 1995.
Mars Climate Orbiter. URL: http://mars.jpl.nasa.gov/msp98/orbiter.
M. Rittri. Dimensional inference under polymorphic recursion. In Functional Programming Languages and Computer Architecture, 7th Conference. ACM, 1995.
M. Wand. First-order identities as a defining language. Acta Inf. (14), 1980.
Z. Yang. Encoding types in ML-like languages. In ICPF 98. ACM, 1998.
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
Chen, F., Roşu, G., Venkatesan, R.P. (2003). Rule-Based Analysis of Dimensional Safety. In: Nieuwenhuis, R. (eds) Rewriting Techniques and Applications. RTA 2003. Lecture Notes in Computer Science, vol 2706. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44881-0_15
Download citation
DOI: https://doi.org/10.1007/3-540-44881-0_15
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40254-1
Online ISBN: 978-3-540-44881-5
eBook Packages: Springer Book Archive