Automatic loop-invariant generation anc refinement through selective sampling

Jiaying Li, Jun Sun, Li Li, Quang Loc Le, Shang-Wei Lin
2017 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE)  
Automatic loop-invariant generation is important in program analysis and verification. In this work, we propose a technique for automatic loop-invariant generation through a combination of active learning and verification. Given a Hoare triple of a program containing a loop, we start with randomly testing the program, collect program states at run-time and categorize them based on whether they satisfy the invariant to be discovered. Next, classification techniques are employed to generate
more » ... ate loop invariants automatically. Afterwards, we refine the candidates through selective sampling so as to overcome the lack of sufficient test cases. Only after the candidate invariant cannot be improved further through selective sampling, we verify whether a candidate can be used to prove the Hoare triple. If it cannot, the generated counterexamples are added as new tests and we repeat the above process. Furthermore, we show that by introducing path-sensitive learning, i.e., partitioning the program states according to program locations they visit and classifying each partition separately, we are able to learn disjunctive loop invariants. We have developed a prototype tool and applied it to verify a set of benchmark programs.
doi:10.1109/ase.2017.8115689 dblp:conf/kbse/LiSLLL17 fatcat:7e5e2aae6fatzmpwy7jojosn7m