Solving Conditional Linear Recurrences for Program Verification: The Periodic Case

Author:

Wang Chenglin1ORCID,Lin Fangzhen1ORCID

Affiliation:

1. Hong Kong University of Science and Technology, China

Abstract

In program verification, one method for reasoning about loops is to convert them into sets of recurrences, and then try to solve these recurrences by computing their closed-form solutions. While there are solvers for computing closed-form solutions to these recurrences, their capabilities are limited when the recurrences have conditional expressions, which arise when the body of a loop contains conditional statements. In this paper, we take a step towards solving these recurrences. Specifically, we consider what we call conditional linear recurrences and show that given such a recurrence and an initial value, if the index sequence generated by the recurrence on the initial value is what we call ultimately periodic, then it has a closed-form solution. However, checking whether such a sequence is ultimately periodic is undecidable so we propose a heuristic "generate and verify" algorithm for checking the ultimate periodicity of the sequence and computing closed-form solutions at the same time. We implemented a solver based on this algorithm, and our experiments show that a straightforward program verifier based on our solver and using the SMT solver Z3 is effective in verifying properties of many benchmark programs that contain conditional statements in their loops, and compares favorably to other recurrence-based verification tools. Finally, we also consider extending our results to computing closed-form solutions of recurrences with unknown initial values.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference30 articles.

1. 2021. COMP 2021 - 10th International Competition on Software Verification. https://sv-comp.sosy-lab.org/2021/index.php 2021. COMP 2021 - 10th International Competition on Software Verification. https://sv-comp.sosy-lab.org/2021/index.php

2. A Survey of Symbolic Execution Techniques

3. Boosting k-Induction with Continuously-Refined Invariants

4. Templates and recurrences: better together

5. David C Cooper . 1972. Theorem proving in arithmetic without multiplication. Machine intelligence, 7, 91-99 ( 1972 ), 300. David C Cooper. 1972. Theorem proving in arithmetic without multiplication. Machine intelligence, 7, 91-99 (1972), 300.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3