Optimization of Farkas' Lemma-based linear invariant generation using divide-and-conquer with pruning

IF 1.5 4区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Ruibang Liu, Hongming Liu, Guoqiang Li
{"title":"Optimization of Farkas' Lemma-based linear invariant generation using divide-and-conquer with pruning","authors":"Ruibang Liu,&nbsp;Hongming Liu,&nbsp;Guoqiang Li","doi":"10.1016/j.scico.2025.103361","DOIUrl":null,"url":null,"abstract":"<div><div>Formal verification plays a critical role in contemporary computer science, offering mathematically rigorous methods to ensure the correctness, reliability, and security of programs. Loops, due to their complexity and uncertainty, have become a major challenge in program verification. Loop invariants are often employed to abstract the properties of loops within a program, making the automatic generation of such invariants a pivotal challenge. Among the various methods, template-based frameworks grounded in Farkas' Lemma are recognized for their effectiveness in generating tight invariants in the realm of constraint solving. Recent advances have identified the conversion from conjunctive normal form (CNF) to disjunctive normal form (DNF) as a major bottleneck, leading to a combinatorial explosion. In this study, we introduce an optimized algorithm to address the combinatorial explosion by trading off space for time efficiency. Our approach employs two key strategies, divide-and-conquer, and pruning, to boost speed. First, we apply a divide-and-conquer strategy to decompose a complex problem into smaller, more manageable subproblems that can be solved quickly and in parallel. Second, we intelligently apply a pruning strategy, navigating the depth-first search process to avoid unnecessary checks. These improvements maintain the accuracy and speed up the analysis. We constructed a small dataset to showcase the superiority of our tool, which achieved an average speedup of 9.27x on this dataset. The experiments demonstrate that our method provides significant acceleration while maintaining accuracy and indicate that our approach outperforms the state-of-the-art methods.</div></div>","PeriodicalId":49561,"journal":{"name":"Science of Computer Programming","volume":"247 ","pages":"Article 103361"},"PeriodicalIF":1.5000,"publicationDate":"2025-07-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Science of Computer Programming","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0167642325001005","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

Formal verification plays a critical role in contemporary computer science, offering mathematically rigorous methods to ensure the correctness, reliability, and security of programs. Loops, due to their complexity and uncertainty, have become a major challenge in program verification. Loop invariants are often employed to abstract the properties of loops within a program, making the automatic generation of such invariants a pivotal challenge. Among the various methods, template-based frameworks grounded in Farkas' Lemma are recognized for their effectiveness in generating tight invariants in the realm of constraint solving. Recent advances have identified the conversion from conjunctive normal form (CNF) to disjunctive normal form (DNF) as a major bottleneck, leading to a combinatorial explosion. In this study, we introduce an optimized algorithm to address the combinatorial explosion by trading off space for time efficiency. Our approach employs two key strategies, divide-and-conquer, and pruning, to boost speed. First, we apply a divide-and-conquer strategy to decompose a complex problem into smaller, more manageable subproblems that can be solved quickly and in parallel. Second, we intelligently apply a pruning strategy, navigating the depth-first search process to avoid unnecessary checks. These improvements maintain the accuracy and speed up the analysis. We constructed a small dataset to showcase the superiority of our tool, which achieved an average speedup of 9.27x on this dataset. The experiments demonstrate that our method provides significant acceleration while maintaining accuracy and indicate that our approach outperforms the state-of-the-art methods.
基于Farkas引理的线性不变生成方法的分治与剪枝优化
形式验证在当代计算机科学中起着至关重要的作用,它提供了数学上严格的方法来确保程序的正确性、可靠性和安全性。循环由于其复杂性和不确定性,已成为程序验证的主要挑战。循环不变量经常被用来抽象程序中循环的属性,这使得自动生成这种不变量成为一个关键的挑战。在各种方法中,基于Farkas引理的基于模板的框架因其在约束求解领域生成紧密不变量的有效性而得到认可。最近的进展已经确定了从合取范式(CNF)到析取范式(DNF)的转换是导致组合爆炸的主要瓶颈。在本研究中,我们引入了一种优化算法来解决组合爆炸,通过权衡空间和时间效率。我们的方法采用了两个关键策略,分而治之和修剪,以提高速度。首先,我们采用分而治之的策略将复杂问题分解为更小、更易于管理的子问题,这些子问题可以快速并行地解决。其次,我们智能地应用修剪策略,导航深度优先搜索过程以避免不必要的检查。这些改进保持了准确性并加快了分析速度。我们构建了一个小数据集来展示我们的工具的优越性,它在这个数据集上实现了9.27倍的平均加速。实验表明,我们的方法在保持精度的同时提供了显著的加速,并表明我们的方法优于最先进的方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Science of Computer Programming
Science of Computer Programming 工程技术-计算机:软件工程
CiteScore
3.80
自引率
0.00%
发文量
76
审稿时长
67 days
期刊介绍: Science of Computer Programming is dedicated to the distribution of research results in the areas of software systems development, use and maintenance, including the software aspects of hardware design. The journal has a wide scope ranging from the many facets of methodological foundations to the details of technical issues andthe aspects of industrial practice. The subjects of interest to SCP cover the entire spectrum of methods for the entire life cycle of software systems, including • Requirements, specification, design, validation, verification, coding, testing, maintenance, metrics and renovation of software; • Design, implementation and evaluation of programming languages; • Programming environments, development tools, visualisation and animation; • Management of the development process; • Human factors in software, software for social interaction, software for social computing; • Cyber physical systems, and software for the interaction between the physical and the machine; • Software aspects of infrastructure services, system administration, and network management.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信