Open Access. Powered by Scholars. Published by Universities.®
Physical Sciences and Mathematics Commons™
Open Access. Powered by Scholars. Published by Universities.®
Articles 1 - 1 of 1
Full-Text Articles in Physical Sciences and Mathematics
Osprey: A Practical Type System For Validating Dimensional Unit Correctness Of C Programs, Lingxiao Jiang, Zhendong Su
Osprey: A Practical Type System For Validating Dimensional Unit Correctness Of C Programs, Lingxiao Jiang, Zhendong Su
Research Collection School Of Computing and Information Systems
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 …