A Foundation for Flow-Based Program Matching Using Temporal Logic and Model Checking

被引:30
作者
Brunel, Julien [1 ]
Doligez, Damien
Hansen, Rene Rydhof [2 ]
Lawall, Julia L. [1 ]
Muller, Gilles [3 ]
机构
[1] Univ Copenhagen, DIKU, DK-1168 Copenhagen, Denmark
[2] Aalborg Univ, Dept Comp Sci, Aalborg, Denmark
[3] Ecole Mines Nantes, Nantes, France
关键词
Algorithms; Languages; Theory; Program transformation; bug finding; program matching; CTL; model checking;
D O I
10.1145/1594834.1480897
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Reasoning about program control-flow paths is an important functionality of a number of recent program matching languages and associated searching and transformation tools. Temporal logic provides a well-defined means of expressing properties of control-flow paths in programs, and indeed an extension of the temporal logic CTL has been applied to the problem of specifying and verifying the transformations commonly performed by optimizing compilers. Nevertheless, in developing the Coccinelle program transformation tool for performing Linux collateral evolutions in systems code, we have found that existing variants of CTL do not adequately support rules that transform subterms other than the ones matching an entire formula. Being able to transform any of the subterms of a matched term seems essential in the domain targeted by Coccinelle. In this paper, we propose an extension to CTL named CTL-VW (CTL with variables and witnesses) that is a suitable basis for the semantics and implementation of the Coccinelle's program matching language. Our extension to CTL includes existential quantification over program fragments, which allows metavariables in the program matching language to range over different values within different control-flow paths, and a notion of witnesses that record such existential bindings for use in the subsequent program transformation process. We formalize CTL-VW and describe its use in the context of Coccinelle. We then assess the performance of the approach in practice, using a transformation rule that fixes several reference count bugs in Linux code.
引用
收藏
页码:114 / 126
页数:13
相关论文
共 24 条
[1]   On the automatic evolution of an OS kernel using temporal logic and AOP [J].
Åberg, RA ;
Lawall, JL ;
Südholt, M ;
Muller, G ;
Le Meur, AF .
18TH IEEE INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2003, :196-204
[2]  
Ball T., 2006, Operating Systems Review, V40, P73, DOI 10.1145/1218063.1217943
[3]  
Bertot Y., 2004, TEXT THEORET COMP S
[4]  
Bohn J, 1998, LECT NOTES COMPUT SC, V1530, P283
[5]  
BRYANT RE, 1986, IEEE T COMPUT, V35, P677, DOI 10.1109/TC.1986.1676819
[6]  
CHAN D, 1988, 5TH P INTL C S LOG P, P111
[7]   AUTOMATIC VERIFICATION OF FINITE-STATE CONCURRENT SYSTEMS USING TEMPORAL LOGIC SPECIFICATIONS [J].
CLARKE, EM ;
EMERSON, EA ;
SISTLA, AP .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1986, 8 (02) :244-263
[8]  
Corbett JC, 2000, LECT NOTES COMPUT SC, V1885, P205
[9]  
DE Moor O., 2003, Higher-Order and Symbolic Computation, V16, P15, DOI 10.1023/A:1023063919574
[10]  
Engler D, 2000, USENIX ASSOCIATION PROCEEDINGS OF THE FOURTH SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, P1