Automatic loop-invariant generation and refinement through selective sampling

Automatic loop-invariant generation is important in program analysis and verification. In this paper, we propose to generate loop-invariants automatically through learning and verification. Given a Hoare triple of a program containing a loop, we start with randomly testing the program, collect progr...

Full description

Saved in:
Bibliographic Details
Main Authors: LI, Jiaying, SUN, Jun, LI, Li, LE, Quang Loc, LIN, Shang-Wei
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2017
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/4712
https://ink.library.smu.edu.sg/context/sis_research/article/5715/viewcontent/Automatic_loop_variant_ase17_av.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-5715
record_format dspace
spelling sg-smu-ink.sis_research-57152020-01-09T07:04:35Z Automatic loop-invariant generation and refinement through selective sampling LI, Jiaying SUN, Jun LI, Li LE, Quang Loc LIN, Shang-Wei Automatic loop-invariant generation is important in program analysis and verification. In this paper, we propose to generate loop-invariants automatically through 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 a candidate loop-invariant automatically. Afterwards, we refine the candidate through selective sampling so as to overcome the lack of sufficient test cases. Only after a candidate invariant cannot be improved further through selective sampling, we verify whether it 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 a 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. In order to evaluate our idea, a prototype tool has been developed and the experiment results show that our approach complements existing approaches. 2017-11-03T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/4712 info:doi/10.1109/ASE.2017.8115689 https://ink.library.smu.edu.sg/context/sis_research/article/5715/viewcontent/Automatic_loop_variant_ase17_av.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Active learning classification Loop-invariant program verification selective sampling Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Active learning
classification
Loop-invariant
program verification
selective sampling
Software Engineering
spellingShingle Active learning
classification
Loop-invariant
program verification
selective sampling
Software Engineering
LI, Jiaying
SUN, Jun
LI, Li
LE, Quang Loc
LIN, Shang-Wei
Automatic loop-invariant generation and refinement through selective sampling
description Automatic loop-invariant generation is important in program analysis and verification. In this paper, we propose to generate loop-invariants automatically through 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 a candidate loop-invariant automatically. Afterwards, we refine the candidate through selective sampling so as to overcome the lack of sufficient test cases. Only after a candidate invariant cannot be improved further through selective sampling, we verify whether it 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 a 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. In order to evaluate our idea, a prototype tool has been developed and the experiment results show that our approach complements existing approaches.
format text
author LI, Jiaying
SUN, Jun
LI, Li
LE, Quang Loc
LIN, Shang-Wei
author_facet LI, Jiaying
SUN, Jun
LI, Li
LE, Quang Loc
LIN, Shang-Wei
author_sort LI, Jiaying
title Automatic loop-invariant generation and refinement through selective sampling
title_short Automatic loop-invariant generation and refinement through selective sampling
title_full Automatic loop-invariant generation and refinement through selective sampling
title_fullStr Automatic loop-invariant generation and refinement through selective sampling
title_full_unstemmed Automatic loop-invariant generation and refinement through selective sampling
title_sort automatic loop-invariant generation and refinement through selective sampling
publisher Institutional Knowledge at Singapore Management University
publishDate 2017
url https://ink.library.smu.edu.sg/sis_research/4712
https://ink.library.smu.edu.sg/context/sis_research/article/5715/viewcontent/Automatic_loop_variant_ase17_av.pdf
_version_ 1770574986922164224