Templates and recurrences: better together
Jason Breck, John Cyphert, Zachary Kincaid, Thomas W. Reps
摘要
This paper is the confluence of two streams of ideas in the literature on generating numerical invariants, namely: (1) template-based methods, and (2) recurrence-based methods.
A template-based method begins with a template that contains unknown quantities, and finds invariants that match the template by extracting and solving constraints on the unknowns. A disadvantage of template-based methods is that they require fixing the set of terms that may appear in an invariant in advance. This disadvantage is particularly prominent for non-linear invariant generation, because the user must supply maximum degrees on polynomials, bases for exponents, etc.
On the other hand, recurrence-based methods are able to find sophisticated non-linear mathematical relations, including polynomials, exponentials, and logarithms, because such relations arise as the solutions to recurrences. However, a disadvantage of past recurrence-based invariant-generation methods is that they are primarily loop-based analyses: they use recurrences to relate the pre-state and post-state of a loop, so it is not obvious how to apply them to a recursive procedure, especially if the procedure is non-linearly recursive (e.g., a tree-traversal algorithm).
In this paper, we combine these two approaches and obtain a technique that uses templates in which the unknowns are functions rather than numbers, and the constraints on the unknowns are recurrences. The technique synthesizes invariants involving polynomials, exponentials, and logarithms, even in the presence of arbitrary control-flow, including any combination of loops, branches, and (possibly non-linear) recursion. For instance, it is able to show that (i) the time taken by merge-sort is O(n log(n)), and (ii) the time taken by Strassen's algorithm is O(n log 2 (7) ).
This paper is an extended version of a paper with the same title at PLDI 2020 [5].
• Software and its engineering → Automated static analysis; • Theory of computation → Program analysis.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper10
- This is the moment for probabilistic loopsMarcel Moosbrugger, Miroslav Stankovic, Ezio Bartocci, Laura KovácsOOPSLA 2022 · 被引用 30 次
- Dynaplex: analyzing program complexity using dynamically inferred recurrence relationsDidier Ishimwe, KimHao Nguyen, ThanhVu NguyenOOPSLA 2021 · 被引用 16 次
- Affine Loop Invariant Generation via Matrix AlgebraYucheng Ji, Hongfei Fu, Bin Fang, Haibo ChenCAV 2022 · 被引用 10 次
- Synthesis with Asymptotic Resource BoundsQinheping Hu, John Cyphert, Loris D'Antoni, Thomas W. RepsCAV 2021 · 被引用 5 次
- Newtonian Program Analysis of Probabilistic ProgramsDi Wang, Thomas W. RepsOOPSLA 2024 · 被引用 3 次
相关 Paper
- Solvable Polynomial Ideals: The Ideal Reflection for Program AnalysisJohn Cyphert, Zachary KincaidPOPL 2024 · 被引用 11 次
- On Polynomial Expressions with C-Finite Recurrences in Loops with Nested Nondeterministic BranchesChenglin Wang, Fangzhen LinCAV 2024 · 被引用 3 次
- Simple Linear Loops: Algebraic Invariants and ApplicationsRida Ait El Manssour, George Kenison, Mahsa Shirmohammadi, Anton VaronkaPOPL 2025 · 被引用 2 次
- Demystifying Template-Based Invariant Generation for Bit-Vector ProgramsPeisen Yao, Jingyu Ke, Jiahui Sun, Hongfei Fu 等ASE 2023 · 被引用 3 次
- Scalable linear invariant generation with Farkas' lemmaHongming Liu, Hongfei Fu, Zhiyong Yu, Jiaxin Song 等OOPSLA 2022 · 被引用 15 次
