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.
- 2021. COMP 2021 - 10th International Competition on Software Verification. https://sv-comp.sosy-lab.org/2021/index.php
Google Scholar
- Roberto Baldoni, Emilio Coppa, Daniele Cono D’elia, Camil Demetrescu, and Irene Finocchi. 2018. A survey of symbolic execution techniques. ACM Computing Surveys (CSUR), 51, 3 (2018), 1–39. https://doi.org/10.1145/3182657
Google Scholar
Digital Library
- Dirk Beyer, Matthias Dangl, and Philipp Wendler. 2015. Boosting k-induction with continuously-refined invariants. In International Conference on Computer Aided Verification. 622–640. https://doi.org/10.1007/978-3-319-21690-4_42
Google Scholar
Cross Ref
- Jason Breck, John Cyphert, Zachary Kincaid, and Thomas Reps. 2020. Templates and recurrences: Better together. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation. 688–702. https://doi.org/10.1145/3385412.3386035
Google Scholar
Digital Library
- David C Cooper. 1972. Theorem proving in arithmetic without multiplication. Machine intelligence, 7, 91-99 (1972), 300.
Google Scholar
- John Cyphert, Jason Breck, Zachary Kincaid, and Thomas Reps. 2019. Refinement of path expressions for static analysis. Proceedings of the ACM on Programming Languages, 3, POPL (2019), 1–29. https://doi.org/10.1145/3290358
Google Scholar
Digital Library
- Priyanka Darke, Sakshi Agrawal, and R Venkatesh. 2021. VeriAbs: A tool for scalable verification by abstraction (competition contribution). In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. 458–462. https://doi.org/10.1007/978-3-030-72013-1_32
Google Scholar
Digital Library
- Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems. 337–340. https://doi.org/10.1007/978-3-540-78800-3_24
Google Scholar
Cross Ref
- Isil Dillig, Thomas Dillig, Boyang Li, and Ken McMillan. 2013. Inductive invariant generation via abductive inference. Acm Sigplan Notices, 48, 10 (2013), 443–456. https://doi.org/10.1145/2544173.2509511
Google Scholar
Digital Library
- A. Farzan and Z. Kincaid. 2015. Compositional recurrence analysis. In 2015 Formal Methods in Computer-Aided Design (FMCAD). 57–64. https://doi.org/10.1109/FMCAD.2015.7542253
Google Scholar
Cross Ref
- Sumit Gulwani and Florian Zuleger. 2010. The reachability-bound problem. In Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation. 292–304. https://doi.org/10.1145/1806596.1806630
Google Scholar
Digital Library
- Christoph Haase and Simon Halfon. 2014. Integer vector addition systems with states. In International Workshop on Reachability Problems. 112–124. https://doi.org/10.1007/978-3-319-11439-2_9
Google Scholar
Cross Ref
- Roger A Horn and Charles R Johnson. 2012. Matrix analysis. Cambridge university press.
Google Scholar
Digital Library
- Bertrand Jeannet, Peter Schrammel, and Sriram Sankaranarayanan. 2014. Abstract Acceleration of General Linear Loops. SIGPLAN Not., 49, 1 (2014), jan, 529–540. issn:0362-1340 https://doi.org/10.1145/2578855.2535843
Google Scholar
Digital Library
- Richard M Karp and Raymond E Miller. 1969. Parallel program schemata. Journal of Computer and system Sciences, 3, 2 (1969), 147–195.
Google Scholar
Digital Library
- Zachary Kincaid, Jason Breck, Ashkan Forouhi Boroujeni, and Thomas Reps. 2017. Compositional Recurrence Analysis Revisited. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). Association for Computing Machinery, New York, NY, USA. 248–262. isbn:9781450349888 https://doi.org/10.1145/3062341.3062373
Google Scholar
Digital Library
- Zachary Kincaid, Jason Breck, John Cyphert, and Thomas Reps. 2019. Closed Forms for Numerical Loops. Proc. ACM Program. Lang., 3, POPL (2019), Article 55, Jan., 29 pages. https://doi.org/10.1145/3290368
Google Scholar
Digital Library
- Zachary Kincaid, John Cyphert, Jason Breck, and Thomas Reps. 2017. Non-linear reasoning for invariant synthesis. Proceedings of the ACM on Programming Languages, 2, POPL (2017), 1–33. https://doi.org/10.1145/3158142
Google Scholar
Digital Library
- Laura Kovács. 2008. Reasoning algebraically about p-solvable loops. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. 249–264. https://doi.org/10.1007/978-3-540-78800-3_18
Google Scholar
Cross Ref
- Fangzhen Lin. 2016. A formalization of programs in first-order logic with a discrete linear order. Artificial Intelligence, 235 (2016), 1–25. issn:0004-3702 https://doi.org/10.1016/j.artint.2016.01.014
Google Scholar
Digital Library
- Zohar Manna. 1979. Mathematical theory of computation. Journal of Symbolic Logic, 44, 1 (1979).
Google Scholar
- Aaron Meurer, Christopher P Smith, Mateusz Paprocki, Ondřej Čertík, Sergey B Kirpichev, Matthew Rocklin, AMiT Kumar, Sergiu Ivanov, Jason K Moore, and Sartaj Singh. 2017. SymPy: symbolic computing in Python. PeerJ Computer Science, 3 (2017), e103. https://doi.org/10.7717/peerj-cs.103
Google Scholar
Cross Ref
- Joël Ouaknine and James Worrell. 2012. Decision problems for linear recurrence sequences. In International Workshop on Reachability Problems. 21–28. https://doi.org/10.1007/978-3-642-33512-9_3
Google Scholar
Cross Ref
- Marko Petkovsek, Herbert S. Wilf, and Doron Zeilberger. 1996. A = B. Wellesley, Mass. : A K Peters.
Google Scholar
- Pritom Rajkhowa. 2019. VIAP : an automated system for verifying integer assignment programs with loops. Ph. D. Dissertation. https://doi.org/10.14711/thesis-991012758169203412
Google Scholar
Cross Ref
- Pritom Rajkhowa and Fangzhen Lin. 2019. VIAP 1.1. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. 250–255. https://doi.org/10.1007/978-3-030-17502-3_23
Google Scholar
Cross Ref
- Darren Redfern. 2012. The maple handbook: maple V release 4. Springer Science & Business Media.
Google Scholar
- Rahul Sharma, Isil Dillig, Thomas Dillig, and Alex Aiken. 2011. Simplifying loop invariant generation using splitter predicates. In International Conference on Computer Aided Verification. 703–719. https://doi.org/10.1007/978-3-642-22110-1_57
Google Scholar
Cross Ref
- Chenglin Wang and Fangzhen Lin. 2023. OOPSLA 2023 Artifact for “Solving Conditional Linear Recurrences for Program Verification: The Periodic Case”. https://doi.org/10.1145/3554354
Google Scholar
Digital Library
- Stephen Wolfram. 1999. The MATHEMATICA® book, version 4. Cambridge university press.
Google Scholar
Index Terms
Solving Conditional Linear Recurrences for Program Verification: The Periodic Case
Recommendations
Closed forms for numerical loops
This paper investigates the problem of reasoning about non-linear behavior of simple numerical loops. Our approach builds on classical techniques for analyzing the behavior of linear dynamical systems. It is well-known that a closed-form representation ...
Program Verification by Using DISCOVERER
Verified Software: Theories, Tools, ExperimentsRecent advances in program verification indicate that various verification problems can be reduced to semi-algebraic system (SAS for short) solving. An SAS consists of polynomial equations and polynomial inequalities. Algorithms for quantifier ...
Symbolic Summation in Difference Rings and Applications
ISSAC '16: Proceedings of the ACM on International Symposium on Symbolic and Algebraic ComputationSymbolic summation started with Abramov (1971) for rational sequences and has been pushed forward by Gosper (1978), Zeilberger (1991), Petkovsek (1992) and Paule (1995) to tackle indefinite and definite sums for hypergeometric expressions. In the last ...






Comments