{"title":"PBLInv: Postcondition-based Loop Invariant Learning for C Programs","authors":"Hong Lu, Chengyi Wang, Jiacheng Gui, Hao Huang","doi":"10.1109/QRS51102.2020.00013","DOIUrl":null,"url":null,"abstract":"It is challenging to generate loop invariants for programs automatically in the field of software analysis and verification. Loop invariants are the weakened forms of the postconditions for loops. Therefore, we propose PBLInv, a postcondition-based approach to generate loop invariants for C programs with the machine learning method. First, we generate the postcondition for a loop program automatically. Second, we learn classifiers as the updated candidate loop invariants with the Kernel Support Vector Machine (KSVM) method iteratively. PBLInv is evaluated with 60 benchmark programs collected from the recent papers and the 2019 Software Verification Competitions (SV-Comp 2019). The experimental results show that PBLInv is efficient at learning loop invariants for C programs. Compared with five state-of-the-art methods of generating loop invariants, PBLInv not only generates loop invariants for more benchmarks, but also reduces the number of used samples and iterations for learning loop invariants.","PeriodicalId":301814,"journal":{"name":"2020 IEEE 20th International Conference on Software Quality, Reliability and Security (QRS)","volume":"34 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE 20th International Conference on Software Quality, Reliability and Security (QRS)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/QRS51102.2020.00013","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
It is challenging to generate loop invariants for programs automatically in the field of software analysis and verification. Loop invariants are the weakened forms of the postconditions for loops. Therefore, we propose PBLInv, a postcondition-based approach to generate loop invariants for C programs with the machine learning method. First, we generate the postcondition for a loop program automatically. Second, we learn classifiers as the updated candidate loop invariants with the Kernel Support Vector Machine (KSVM) method iteratively. PBLInv is evaluated with 60 benchmark programs collected from the recent papers and the 2019 Software Verification Competitions (SV-Comp 2019). The experimental results show that PBLInv is efficient at learning loop invariants for C programs. Compared with five state-of-the-art methods of generating loop invariants, PBLInv not only generates loop invariants for more benchmarks, but also reduces the number of used samples and iterations for learning loop invariants.