Program Analysis as Constraint Solving

被引:76
作者
Gulwani, Sumit [1 ]
Srivastava, Saurabh
Venkatesan, Ramarathnam [1 ]
机构
[1] Microsoft Res, Redmond, WA USA
来源
PLDI'08: PROCEEDINGS OF THE 2008 SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN & IMPLEMENTATION | 2008年
关键词
Program Verification; Weakest Precondition; Strongest Postcondition; Most-general Counterexamples; Bounds Analysis; Non-termination Analysis; Constraint Solving;
D O I
10.1145/1375581.1375616
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A constraint-based approach to invariant generation in programs translates a program into constraints that are solved using off-the-shelf constraint solvers to yield desired program invariants. In this paper we show how the constraint-based approach can be used to model a wide spectrum of program analyses in an expressive domain containing disjunctions and conjunctions of linear inequalities. In particular, we show how to model the problem of context-sensitive interprocedural program verification. We also present the first constraint-based approach to weakest precondition and strongest postcondition inference. The constraints we generate are boolean combinations of quadratic inequalities over integer variables. We reduce these constraints to SAT formulae using bit-vector modeling and use off-the-shelf SAT solvers to solve them. Furthermore, we present interesting applications of the above analyses, namely bounds analysis and generation of most-general counter-examples for both safety and termination properties. We also present encouraging preliminary experimental results demonstrating the feasibility of our technique on a variety of challenging examples.
引用
收藏
页码:281 / +
页数:3
相关论文
共 41 条
[1]  
[Anonymous], POPL
[2]  
[Anonymous], POPL
[3]  
Balaban I, 2006, LECT NOTES COMPUT SC, V3855, P267
[4]  
BERDINE J, 2007, POPL, P311
[5]   Path Invariants [J].
Beyer, Dirk ;
Henzinger, Thomas A. ;
Majumdar, Rupak ;
Rybalchenko, Andrey .
PLDI'07: PROCEEDINGS OF THE 2007 ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, 2007, :300-309
[6]  
Beyer D, 2007, LECT NOTES COMPUT SC, V4349, P378
[7]  
Blanchet B, 2002, LECT NOTES COMPUT SC, V2566, P85
[8]  
Bradley AR, 2006, LECT NOTES COMPUT SC, V4281, P35
[9]  
BRADLEY AR, 2005, LECT NOTES COMPUTER, V3576
[10]  
Colon M. A., 2002, Computer Aided Verification. 14th International Conference, CAV 2002. Proceedings (Lecture Notes in Computer Science Vol.2404), P442