A Precise Yet Efficient Memory Model For C

被引:24
作者
Cohen, Ernie [1 ]
Moskal, Michal [2 ]
Tobies, Stephan [2 ]
Schulte, Wolfram [1 ]
机构
[1] Microsoft Corp, Redmond, WA 98052 USA
[2] European Microsoft Innovat Ctr, Aachen, Germany
关键词
deductive program verification; C programming language; memory models;
D O I
10.1016/j.entcs.2009.09.061
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Verification for OO programs typically starts from a strongly typed object model in which distinct objects/fields are guaranteed not to overlap. This model simplifies verification by eliminating all "uninteresting" aliasing and allowing the use of more efficient frame axioms. Unfortunately, this model is unsound and incomplete for languages like C, where "objects" can overlap almost arbitrarily. Sound verification for C therefore typically starts from an untyped memory model, where memory is just an array of bytes. The untyped model, however, adds substantial annotation burden, and reasoning in the untyped model is computationally expensive. We propose a sound, typed semantics for C that provides the annotational and computational advantages of the typed object model while remaining sound and complete for C. We maintain a predicate identifying where the "valid" objects are, and introduce invariants and proof obligations that guarantee that the valid objects are suitably antialiased, and that (almost) all objects appearing in the program are valid. We describe the implementation of this approach in VCC (a sound verifier for C being used to verify the Microsoft Hypervisor) and the resulting performance gains.
引用
收藏
页码:85 / 103
页数:19
相关论文
共 22 条
[1]  
Alkassar E., 2008, VERIFICATIO IN PRESS
[2]  
[Anonymous], 2008, HAVOC PROPERTY CHECK
[3]  
Barnes J., 2003, HIGH INTEGRITY SOFTW
[4]  
Barnett M, 2005, LECT NOTES COMPUT SC, V3362, P49
[5]  
Barnett M, 2006, LECT NOTES COMPUT SC, V4111, P364
[6]  
Cohen E., 2009, MSRTR200915
[7]  
Condit Jeremy, 2008, MSRTR200896
[8]  
Crocker David, 2007, VERIFICATIO IN PRESS
[9]   Z3: An efficient SMT solver [J].
de Moura, Leonardo ;
Bjorner, Nikolaj .
TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, 2008, 4963 :337-340
[10]  
DeLine Rob, 2005, MSRTR200570