A novel data-driven approach on inferring loop invariants for C programs

Hong Lu,Huitao Wang,Jiacheng Gui,Panfeng Chen,Hao Huang
DOI: https://doi.org/10.1016/j.cola.2022.101135
IF: 1.778
2022-01-01
Journal of Computer Languages
Abstract:Inspired by the procedure that experts construct loop invariants, we propose a novel data-driven approach to automatically infer loop invariants. The approach consists of two phases, data-driven inference of candidate invariants and validity check of loop invariants. Inspired by the procedure that experts construct loop invariants, we propose a novel data-driven approach to automatically infer loop invariants for C programs. The approach consists of two phases, data-driven inference of candidate invariants and validity check of loop invariants. The first phase generates candidate invariants by solving polynomial equations and synthesizing the extended loop conditions. The second phase prunes out spurious predicates and redundant predicates in the candidate invariants. The experimental results demonstrate that the proposed approach generates valid invariants for 35 benchmarks out of 38. The proposed approach costs less time to generate more informative and precise invariants than the state-of-the-art methods.
What problem does this paper attempt to address?