Osprey: A practical type system for validating dimensional unit correctness of C programs

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 fo...

全面介紹

Saved in:
書目詳細資料
Main Authors: JIANG, Lingxiao, SU, Zhendong
格式: text
語言:English
出版: Institutional Knowledge at Singapore Management University 2006
主題:
在線閱讀:https://ink.library.smu.edu.sg/sis_research/1331
https://ink.library.smu.edu.sg/context/sis_research/article/2330/viewcontent/OspreyPracticalSystemValidatingUnitCorrect_2006.pdf
標簽: 添加標簽
沒有標簽, 成為第一個標記此記錄!
機構: Singapore Management University
語言: English
id sg-smu-ink.sis_research-2330
record_format dspace
spelling sg-smu-ink.sis_research-23302017-02-05T01:56:33Z Osprey: A practical type system for validating dimensional unit correctness of C programs JIANG, Lingxiao SU, Zhendong 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. 2006-05-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/1331 info:doi/10.1145/1134285.1134323 https://ink.library.smu.edu.sg/context/sis_research/article/2330/viewcontent/OspreyPracticalSystemValidatingUnitCorrect_2006.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Gaussian elimination measurement units dimensional analysis constraint-based analysis type systems Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Gaussian elimination
measurement units
dimensional analysis
constraint-based analysis
type systems
Software Engineering
spellingShingle Gaussian elimination
measurement units
dimensional analysis
constraint-based analysis
type systems
Software Engineering
JIANG, Lingxiao
SU, Zhendong
Osprey: A practical type system for validating dimensional unit correctness of C programs
description 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.
format text
author JIANG, Lingxiao
SU, Zhendong
author_facet JIANG, Lingxiao
SU, Zhendong
author_sort JIANG, Lingxiao
title Osprey: A practical type system for validating dimensional unit correctness of C programs
title_short Osprey: A practical type system for validating dimensional unit correctness of C programs
title_full Osprey: A practical type system for validating dimensional unit correctness of C programs
title_fullStr Osprey: A practical type system for validating dimensional unit correctness of C programs
title_full_unstemmed Osprey: A practical type system for validating dimensional unit correctness of C programs
title_sort osprey: a practical type system for validating dimensional unit correctness of c programs
publisher Institutional Knowledge at Singapore Management University
publishDate 2006
url https://ink.library.smu.edu.sg/sis_research/1331
https://ink.library.smu.edu.sg/context/sis_research/article/2330/viewcontent/OspreyPracticalSystemValidatingUnitCorrect_2006.pdf
_version_ 1770570968560828416