ACM Home Page
Please provide us with feedback. Feedback
Osprey: a practical type system for validating dimensional unit correctness of C programs
Full text PdfPdf (272 KB)
Source International Conference on Software Engineering archive
Proceedings of the 28th international conference on Software engineering table of contents
Shanghai, China
SESSION: Research papers: test & analysis IV table of contents
Pages: 262 - 271  
Year of Publication: 2006
ISBN:1-59593-375-1
Authors
Lingxiao Jiang  University of California, Davis, CA
Zhendong Su  University of California, Davis, CA
Sponsors
ACM: Association for Computing Machinery
SIGSOFT: ACM Special Interest Group on Software Engineering
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 8,   Downloads (12 Months): 54,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1134285.1134323
What is a DOI?

ABSTRACT

Misuse of measurement units is a common source of errors in scientific applications, but standard type systems do not prevent such errors. Dimensional analysis in physics can be used to manually detect such errors in physical equations. It is, however, not feasible to perform such manual analysis for programs computing physical equations because of code complexity. In this paper, we present a type system to automatically detect potential errors involving measurement units. It is constraint-based: we model units as types and flow of units as constraints. However, standard type checking algorithms are not powerful enough to handle units because of their abelian group nature (e.g., being commutative, multiplicative, and associative). Our system combines techniques such as type inference and Gaussian Elimination to overcome this problem. We have implemented Osprey, a prototype of the system for C programs, and evaluated it on various test programs, including computational physics and mechanical engineering applications. Osprey discovered unknown errors in mature code; it is precise with few false positives; it is also efficient and scales to large programs---we have successfully used it to analyze programs with hundreds of thousands of lines of code.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
 
3
 
4
W. E. Brown. Applied template meta-programming in SIUNITS: the library of unit-based computation, 2001.
 
5
UIUC. Maude. http://maude.cs.uiuc.edu/.
 
6
7
8
 
9
H. Hanche-Olsen. Buckingham's π Theorem. http://www.math.ntnu.no/~hanche/notes/buckingham/buckingham-a5.pdf, 2004.
 
10
C. Harrelson. Program Analysis Mode (PAM) for Emacs. http://www.cs.berkeley.edu/~chrishtr/pam/.
11
 
12
International Systems of Units (SI). http://physics.nist.gov/cuu/Units/.
 
13
L. Jiang and Z. Su. Osprey: A practical type system for validating unit correctness of C programs. http://www.cs.ucdavis.edu/~su/unitfull.pdf, 2005.
 
14
R. Johnson and D. Wagner. Finding user/kernel pointer bugs with type inference. In USENIX Security Symposium, pages 119--134, 2004.
 
15
M. Keller. Eiffel Library for Units of Measurement. http://se.inf.ethz.ch/projects/markus_keller/EiffelUnits.html.
 
16
 
17
J. Kodumal. Banshee--A toolkit for building constraint-based analysis. http://banshee.sourceforge.net/.
 
18
Mars Climate Orbiter Mishap Investigation. ftp://ftp.hq.nasa.gov/pub/pao/reports/1999/MCO_report.pdf.
 
19
 
20
W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery. Numerical Recipes. Cambridge University Press, http://www.nr.com/, 2002.
 
21
D. Quinlan, M. Schordan, R. Vuduc, and Q. Yi. ROSE: A Compiler Framework. http://www.llnl.gov/CASC/rose/, release soon.
22
23
 
24
G. Rosu and F. Chen. Certifying measurement unit safety policy. ASE, 2003.
 
25
SoftIntegration©. Ch User's Guide and Ch Mechanism Toolkit User's Guide. http://www.softintegration.com/.
 
26
M. Wand and P. O'Keefe. Automatic dimensional inference. In Computational Logic--Essays in Honor of Alan Robinson, pages 479--483, 1991.


Collaborative Colleagues:
Lingxiao Jiang: colleagues
Zhendong Su: colleagues