A foundation for flow-based program matching: using temporal logic and model checking - Archive ouverte HAL
Communication Dans Un Congrès Année : 2009

A foundation for flow-based program matching: using temporal logic and model checking

Résumé

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 CTLVW (CTL with variables and witnesses) that is a suitable basis for the semantics and implementation of the Coccinelles 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.
Fichier non déposé

Dates et versions

hal-01299040 , version 1 (07-04-2016)

Identifiants

Citer

Julien Brunel, Damien Doligez, René Rydhof Hansen, Julia L. Lawall, Gilles Muller. A foundation for flow-based program matching: using temporal logic and model checking. The 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL'09, Jan 2009, Savannah, Georgia, United States. pp.114-126, ⟨10.1145/1480881.1480897⟩. ⟨hal-01299040⟩
173 Consultations
0 Téléchargements

Altmetric

Partager

More