Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Refinement of path expressions for static analysis

Published: 02 January 2019 Publication History

Abstract

Algebraic program analyses compute information about a program’s behavior by first (a) computing a valid path expression—i.e., a regular expression that recognizes all feasible execution paths (and usually more)—and then (b) interpreting the path expression in a semantic algebra that defines the analysis. There are an infinite number of different regular expressions that qualify as valid path expressions, which raises the question “Which one should we choose?” While any choice yields a sound result, for many analyses the choice can have a drastic effect on the precision of the results obtained. This paper investigates the following two questions: (1) What does it mean for one valid path expression to be “better” than another? (2) Can we compute a valid path expression that is “better,” and if so, how? We show that it is not satisfactory to compare two path expressions E1 and E2 solely by means of the languages that they generate. Counter to one’s intuition, it is possible for L(E2) ⊊ L(E1), yet for E2 to produce a less-precise analysis result than E1—and thus we would not want to perform the transformation E1E2. However, the exclusion of paths so as to analyze a smaller language of paths is exactly the refinement criterion used by some prior methods.
In this paper, we develop an algorithm that takes as input a valid path expression E, and returns a valid path expression E′ that is guaranteed to yield analysis results that are at least as good as those obtained using E. While the algorithm sometimes returns E itself, it typically does not: (i) we prove a no-degradation result for the algorithm’s base case—for transforming a leaf loop (i.e., a most-deeply-nested loop); (ii) at a non-leaf loop L, the algorithm treats each loop L′ in the body of L as an indivisible atom, and applies the leaf-loop algorithm to L; the no-degradation result carries over to (ii), as well. Our experiments show that the technique has a substantial impact: the loop-refinement algorithm allows the implementation of Compositional Recurrence Analysis to prove over 25% more assertions for a collection of challenging loop micro-benchmarks.

Supplementary Material

WEBM File (a45-cyphert.webm)

References

[1]
G. Ammons and J.R. Larus. 1998. Improving Data-flow Analysis with Path Profiles. In PLDI.
[2]
C. Ancourt, F. Coelho, and F. Irigoin. 2010. A Modular Static Analysis Approach to Affine Loop Invariants Detection. Electron. Notes Theor. Comput. Sci. 267, 1 (Oct. 2010), 3–16.
[3]
G. Balakrishnan, S. Sankaranarayanan, F. Ivančić, and A. Gupta. 2009. Refining the Control Structure of Loops using Static Analysis. In EMSOFT.
[4]
T. Ball and S.K. Rajamani. 2001. Bebop: A Path-sensitive Interprocedural Dataflow Engine. In PASTE.
[5]
A. Bouajjani, J. Esparza, and T. Touili. 2003. A Generic Approach to the Static Analysis of Concurrent Programs with Procedures. In Princ. of Prog. Lang. 62–73.
[6]
M. Bozga, C. Gîrlea, and R. Iosif. 2009. Iterating Octagons. In TACAS.
[7]
Q. Carbonneaux, J. Hoffmann, and Z. Shao. 2015. Compositional Certified Resource Bounds. In PLDI.
[8]
P. Cousot and R. Cousot. 2002. Systematic Design of Program Transformation Frameworks by Abstract Interpretation. In POPL.
[9]
P. Cousot and N. Halbwachs. 1978. Automatic Discovery of Linear Constraints Among Variables of a Program. In POPL.
[10]
M. Das, S. Lerner, and M. Seigle. 2002. ESP: Path-Sensitive Program Verification in Polynomial Time. In Prog. Lang. Design and Impl. ACM Press, New York, NY, 57–68.
[11]
I. Dillig, T. Dillig, and A. Aiken. 2008. Sound, Complete and Scalable Path-Sensitive Analysis. In PLDI.
[12]
I. Dillig, T. Dillig, B. Li, and K. McMillan. 2013. Inductive Invariant Generation via Abductive Inference. In OOPSLA.
[13]
M. Elder, J. Lim, T. Sharma, T. Andersen, and T. Reps. 2014. Abstract Domains of Affine Relations. TOPLAS. 36, 4 (Jan. 2014).
[14]
A. Farzan and Z. Kincaid. 2013. An Algebraic Framework for Compositional Program Analysis. CoRR (arXiv) (2013).
[15]
A. Farzan and Z. Kincaid. 2015. Compositional Recurrence Analysis. In FMCAD.
[16]
J.A. Fisher. 1981. Trace Scheduling: A Technique for Global Microcode Compaction. IEEE Trans. on Computers C-30, 7 (1981), 478–490.
[17]
A. Flores-Montoya and R. Hähnle. 2014. Resource analysis of complex programs with cost equations. In APLAS.
[18]
S. Gulwani, S. Jain, and E. Koskinen. 2009. Control-flow Refinement and Progress Invariants for Bound Analysis. In PLDI.
[19]
A. Gurfinkel, T. Kahsai, A. Komuravelli, and J.A. Navas. 2015. The SeaHorn Verification Framework. In CAV.
[20]
M. Heizmann, J. Christ, D. Dietsch, E. Ermis, J. Hoenicke, M. Lindenmann, A. Nutz, C. Schilling, and A. Podelski. 2013. Ultimate Automizer with SMTInterpol (Competition Contribution). In TACAS.
[21]
L.H. Holley and B.K. Rosen. 1981. Qualified Data Flow Problems. Trans. on Softw. Eng. 7, 1 (1981), 60–78.
[22]
B. Jeannet and W. Serwe. 2004. Abstracting Call-Stacks for Interprocedural Verification of Imperative Programs. In AMAST.
[23]
D. Johnson. 1975. Finding All the Elementary Circuits of a Directed Graph. SIAM J. Comput. (1975).
[24]
N. Kidd, A. Lal, and T. Reps. 2007. WALi: The Weighted Automaton Library. http://www.cs.wisc.edu/wpis/wpds/download. php
[25]
Z. Kincaid. 2018. Numerical Invariants via Abstract Machines. In SAS.
[26]
Z. Kincaid, J. Breck, A. Forouhi Boroujeni, and T. Reps. 2017. Compositional Recurrence Analysis Revisited. In PLDI.
[27]
Z. Kincaid, J. Cyphert, J. Breck, and T. Reps. 2018. Non-Linear Reasoning for Invariant Synthesis. PACMPL 2(POPL) (2018), 54:1–54:33.
[28]
A. King and H. Søndergaard. 2010. Automatic Abstraction for Congruences. In VMCAI.
[29]
L. Kot and D. Kozen. 2005. Kleene Algebra and Bytecode Verification. Electr. Notes Theor. Comp. Sci. 141, 1 (2005).
[30]
D. Kozen. 1994. A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events. In IEEE Sym. on Logic in Comp. Sci.
[31]
D. Kozen. 2003. Kleene Algebra with Tests and the Static Analysis of Programs. TR 2003-1915. Dept. of Comp. Sci., Cornell Univ., Ithaca, NY.
[32]
Yi Li, Aws Albarghouthi, Zachary Kincaid, Arie Gurfinkel, and Marsha Chechik. 2014. Symbolic Optimization with SMT Solvers. In Princ. of Prog. Lang. 607–618.
[33]
D.G. Melski. 2002. Interprocedural Path Profiling and the Interprocedural Express-Lane Transformation. Ph.D. Dissertation. Comp. Sci. Dept., Univ. of Wisconsin, Madison, WI. Tech. Rep. 1435.
[34]
M. Müller-Olm and H. Seidl. 2004. Precise Interprocedural Analysis through Linear Algebra. In POPL.
[35]
M. Müller-Olm and H. Seidl. 2007. Analysis of Modular Arithmetic. TOPLAS. 29, 5 (2007).
[36]
T. Reps, S. Horwitz, and M. Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In POPL. 49–61.
[37]
T. Reps, S. Schwoon, S. Jha, and D. Melski. 2005. Weighted Pushdown Systems and their Application to Interprocedural Dataflow Analysis. SCP 58 (2005).
[38]
X. Rival and L. Mauborgne. 2007. The Trace Partitioning Abstract Domain. TOPLAS. 29, 5 (2007).
[39]
M. Sagiv, T. Reps, and S. Horwitz. 1996. Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation. Theor. Comp. Sci. 167 (1996), 131–170.
[40]
Roberto Sebastiani and Silvia Tomasi. 2012. Optimization in SMT with L A(Q) Cost Functions. In IJCAR. 484–498.
[41]
M. Sharir and A. Pnueli. 1981. Two Approaches to Interprocedural Data Flow Analysis. In Program Flow Analysis: Theory and Applications. Prentice-Hall.
[42]
R. Sharma, I. Dillig, T. Dillig, and A. Aiken. 2011. Simplifying Loop Invariant Generation Using Splitter Predicates. In CAV.
[43]
SVCOMP16 2016. 5th Int. Competition on Software Verification (SV-COMP16). https://sv- comp.sosy- lab.org/2016/
[44]
R. Tarjan. 1972. Depth-first Search and Linear Graph Algorithms. SIAM J. Comput. (1972).
[45]
R.E. Tarjan. 1981a. Fast Algorithms for Solving Path Problems. J. ACM 28, 3 (1981), 594–614.
[46]
R.E. Tarjan. 1981b. A Unified Approach to Path Problems. J. ACM 28, 3 (1981), 577–593.
[47]
Y. Xie, A. Chou, and D. Engler. 2003. ARCHER: Using Symbolic, Path-Sensitive Analysis to Detect Memory Access Errors. In ESEC/FSE.

Cited By

View all
  • (2024)Solvable Polynomial Ideals: The Ideal Reflection for Program AnalysisProceedings of the ACM on Programming Languages10.1145/36328678:POPL(724-752)Online publication date: 5-Jan-2024
  • (2024)On Polynomial Expressions with C-Finite Recurrences in Loops with Nested Nondeterministic BranchesComputer Aided Verification10.1007/978-3-031-65627-9_20(409-430)Online publication date: 24-Jul-2024
  • (2023)Solving Conditional Linear Recurrences for Program Verification: The Periodic CaseProceedings of the ACM on Programming Languages10.1145/35860287:OOPSLA1(28-55)Online publication date: 6-Apr-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 3, Issue POPL
January 2019
2275 pages
EISSN:2475-1421
DOI:10.1145/3302515
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 January 2019
Published in PACMPL Volume 3, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Algebraic program analysis
  2. abstract-interpretation precision
  3. control-flow refinement

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)97
  • Downloads (Last 6 weeks)10
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Solvable Polynomial Ideals: The Ideal Reflection for Program AnalysisProceedings of the ACM on Programming Languages10.1145/36328678:POPL(724-752)Online publication date: 5-Jan-2024
  • (2024)On Polynomial Expressions with C-Finite Recurrences in Loops with Nested Nondeterministic BranchesComputer Aided Verification10.1007/978-3-031-65627-9_20(409-430)Online publication date: 24-Jul-2024
  • (2023)Solving Conditional Linear Recurrences for Program Verification: The Periodic CaseProceedings of the ACM on Programming Languages10.1145/35860287:OOPSLA1(28-55)Online publication date: 6-Apr-2023
  • (2023)When Less Is More: Consequence-Finding in a Weak Theory of ArithmeticProceedings of the ACM on Programming Languages10.1145/35712377:POPL(1275-1307)Online publication date: 11-Jan-2023
  • (2021)Regular Path Clauses and Their Application in Solving LoopsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.344.3344(22-35)Online publication date: 13-Sep-2021
  • (2021)A Survey of Parametric Static AnalysisACM Computing Surveys10.1145/346445754:7(1-37)Online publication date: 18-Jul-2021
  • (2021)Termination analysis without the tearsProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454110(1296-1311)Online publication date: 19-Jun-2021
  • (2021)Learning the boundary of inductive invariantsProceedings of the ACM on Programming Languages10.1145/34342965:POPL(1-30)Online publication date: 4-Jan-2021
  • (2021)Reflections on Termination of Linear LoopsComputer Aided Verification10.1007/978-3-030-81688-9_3(51-74)Online publication date: 15-Jul-2021
  • (2021)Algebraic Program AnalysisComputer Aided Verification10.1007/978-3-030-81685-8_3(46-83)Online publication date: 15-Jul-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media