[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to main content

Unbounded Procedure Summaries from Bounded Environments

  • Conference paper
  • First Online:
Verification, Model Checking, and Abstract Interpretation (VMCAI 2021)

Abstract

Modular approaches to verifying interprocedural programs involve learning summaries for individual procedures rather than verifying a monolithic program. Modern approaches based on use of Satisfiability Modulo Theory (SMT) solvers have made much progress in this direction. However, it is still challenging to handle mutual recursion and to derive adequate procedure summaries using scalable methods. We propose a novel modular verification algorithm that addresses these challenges by learning lemmas about the relationships among procedure summaries and by using bounded environments in SMT queries. We have implemented our algorithm in a tool called Clover and report on a detailed evaluation that shows that it outperforms existing automated tools on benchmark programs with mutual recursion while being competitive on standard benchmarks.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
£29.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
GBP 19.95
Price includes VAT (United Kingdom)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
GBP 63.99
Price includes VAT (United Kingdom)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
GBP 79.99
Price includes VAT (United Kingdom)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Expressions such as \( x~\mathrm {mod}~2 = 0\) can be generated by existentially quantifying local variables and then performing quantifier elimination.

  2. 2.

    We lift the ancestor relationship from nodes to their procedures.

  3. 3.

    In the implementation, multiple checks can be done together.

  4. 4.

    We expect that our platform is less performant than the StarExec platform.

  5. 5.

    We did not compare against FreqHorn since it cannot handle nonlinear CHCs.

  6. 6.

    Unlike Spacer it does not use PDR to derive invariants, and unlike Smash it is not limited to predicate abstractions.

References

  1. Albarghouthi, A., Dillig, I., Gurfinkel, A.: Maximal specification synthesis. ACM SIGPLAN Notices 51(1), 789–801 (2016)

    Article  Google Scholar 

  2. Alur, R., Cerný, P., Madhusudan, P., Nam, W.: Synthesis of interface specifications for java classes. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 98–109. ACM (2005)

    Google Scholar 

  3. Amazon Web Services: https://github.com/awslabs/s2n (2019)

  4. Ammons, G., Bodík, R., Larus, J.R.: Mining specifications. ACM Sigplan Notices 37(1), 4–16 (2002)

    Article  Google Scholar 

  5. Asadi, S., et al.: Function summarization modulo theories. In: LPAR. EPiC Series in Computing, vol. 57, pp. 56–75 (2018)

    Google Scholar 

  6. Ball, T., Rajamani, S.K.: Bebop: a path-sensitive interprocedural dataflow engine. In: Proceedings of the 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, pp. 97–103. ACM (2001)

    Google Scholar 

  7. Ball, T., Rajamani, S.K.: The SLAM toolkit. In: Berry, G., Comon, H., Finkel, A. (eds.) CAV 2001. LNCS, vol. 2102, pp. 260–264. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44585-4_25

    Chapter  Google Scholar 

  8. Barrett, C., Tinelli, C.: Satisfiability modulo theories. Handbook of Model Checking, pp. 305–343. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-10575-8_11

    Chapter  Google Scholar 

  9. Beckman, N.E., Nori, A.V.: Probabilistic, modular and scalable inference of typestate specifications. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 211–221. ACM (2011)

    Google Scholar 

  10. Bjørner, N., Janota, M.: Playing with quantified satisfaction. LPAR (short papers) 35, 15–27 (2015)

    Google Scholar 

  11. Blackshear, S., Lahiri, S.K.: Almost-correct specifications: a modular semantic framework for assigning confidence to warnings. In: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 209–218. ACM (2013)

    Google Scholar 

  12. Bradley, A.R.: SAT-based model checking without unrolling. In: Jhala, R., Schmidt, D. (eds.) VMCAI 2011. LNCS, vol. 6538, pp. 70–87. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18275-4_7

    Chapter  Google Scholar 

  13. Champion, A., Kobayashi, N., Sato, R.: HoIce: an ICE-based non-linear horn clause solver. In: Ryu, S. (ed.) APLAS 2018. LNCS, vol. 11275, pp. 146–156. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-02768-1_8

    Chapter  Google Scholar 

  14. CHC-Comp: https://chc-comp.github.io (2019)

  15. Chen, Y.-F., Hsieh, C., Tsai, M.-H., Wang, B.-Y., Wang, F.: Verifying recursive programs using intraprocedural analyzers. In: Müller-Olm, M., Seidl, H. (eds.) SAS 2014. LNCS, vol. 8723, pp. 118–133. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10936-7_8

    Chapter  Google Scholar 

  16. Cimatti, A., Griggio, A.: Software model checking via IC3. In: Madhusudan, P., Seshia, S.A. (eds.) CAV 2012. LNCS, vol. 7358, pp. 277–293. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31424-7_23

    Chapter  Google Scholar 

  17. Clarke, E., Grumberg, O., Jha, S., Lu, Y., Veith, H.: Counterexample-guided abstraction refinement. In: Emerson, E.A., Sistla, A.P. (eds.) CAV 2000. LNCS, vol. 1855, pp. 154–169. Springer, Heidelberg (2000). https://doi.org/10.1007/10722167_15

    Chapter  Google Scholar 

  18. Cousot, P., Cousot, R.: Static determination of dynamic properties of recursive procedures. In: IFIP Conference on Formal Description of Programming Concepts, St. Andrews, NB, Canada, pp. 237–278 (1977)

    Google Scholar 

  19. Cousot, P., Cousot, R., Fähndrich, M., Logozzo, F.: Automatic inference of necessary preconditions. In: Proceedings of International Conference on Verification, Model Checking, and Abstract Interpretation, VMCAI, pp. 128–148 (2013)

    Google Scholar 

  20. Das, A., Lahiri, S.K., Lal, A., Li, Y.: Angelic verification: precise verification modulo unknowns. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 324–342. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_19

    Chapter  Google Scholar 

  21. De Angelis, E., Fioravanti, F., Pettorossi, A., Proietti, M.: VeriMAP: a tool for verifying programs through transformations. In: Ábrahám, E., Havelund, K. (eds.) TACAS 2014. LNCS, vol. 8413, pp. 568–574. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54862-8_47

    Chapter  Google Scholar 

  22. Dietsch, D., Heizmann, M., Hoenicke, J., Nutz, A., Podelski, A.: Ultimate TreeAutomize. HCVS/PERR. EPTCS 296, 42–47 (2019)

    Article  Google Scholar 

  23. Eén, N., Mishchenko, A., Brayton, R.K.: Efficient implementation of property directed reachability. In: Formal Methods in Computer-Aided Design (FMCAD), pp. 125–134. IEEE (2011)

    Google Scholar 

  24. Fähndrich, M., Logozzo, F.: Static contract checking with abstract interpretation. In: Beckert, B., Marché, C. (eds.) FoVeOOS 2010. LNCS, vol. 6528, pp. 10–30. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18070-5_2

    Chapter  Google Scholar 

  25. Fedyukovich, G., Kaufman, S.J., Bodík, R.: Sampling invariants from frequency distributions. In: Formal Methods in Computer Aided Design (FMCAD), pp. 100–107. IEEE (2017)

    Google Scholar 

  26. Fedyukovich, G., Prabhu, S., Madhukar, K., Gupta, A.: Solving constrained horn clauses using syntax and data. In: Formal Methods in Computer Aided Design (FMCAD), pp. 170–178. ACM (2018)

    Google Scholar 

  27. Fedyukovich, G., Prabhu, S., Madhukar, K., Gupta, A.: Quantified invariants via syntax-guided synthesis. In: Dillig, I., Tasiran, S. (eds.) CAV 2019. LNCS, vol. 11561, pp. 259–277. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-25540-4_14

    Chapter  Google Scholar 

  28. Flanagan, C., Leino, K.R.M.: Houdini, an annotation assistant for ESC/Java. In: Oliveira, J.N., Zave, P. (eds.) FME 2001. LNCS, vol. 2021, pp. 500–517. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45251-6_29

    Chapter  Google Scholar 

  29. Garg, P., Löding, C., Madhusudan, P., Neider, D.: ICE: a robust framework for learning invariants. In: Proceedings of the International Conference on Computer Aided Verification (CAV), pp. 69–87 (2014)

    Google Scholar 

  30. Godefroid, P., Huth, M., Jagadeesan, R.: Abstraction-based model checking using modal transition systems. In: Larsen, K.G., Nielsen, M. (eds.) CONCUR 2001. LNCS, vol. 2154, pp. 426–440. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44685-0_29

    Chapter  Google Scholar 

  31. Godefroid, P., Nori, A.V., Rajamani, S.K., Tetali, S.: Compositional may-must program analysis: unleashing the power of alternation. In: Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 43–56. ACM (2010)

    Google Scholar 

  32. Grebenshchikov, S., Lopes, N.P., Popeea, C., Rybalchenko, A.: Synthesizing software verifiers from proof rules. ACM SIGPLAN Notices 47(6), 405–416 (2012)

    Article  Google Scholar 

  33. Gurfinkel, A., Kahsai, T., Komuravelli, A., Navas, J.A.: The seaHorn verification framework. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 343–361. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_20

    Chapter  Google Scholar 

  34. Gurfinkel, A., Wei, O., Chechik, M.: Yasm: a software model-checker for verification and refutation. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 170–174. Springer, Heidelberg (2006). https://doi.org/10.1007/11817963_18

    Chapter  Google Scholar 

  35. Heizmann, M., Hoenicke, J., Podelski, A.: Refinement of trace abstraction. In: Palsberg, J., Su, Z. (eds.) SAS 2009. LNCS, vol. 5673, pp. 69–85. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03237-0_7

    Chapter  Google Scholar 

  36. Henzinger, T.A., Jhala, R., Majumdar, R.: Permissive interfaces. In: Proceedings of the 10th European Software Engineering Conference Held Jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 31–40. ACM (2005)

    Google Scholar 

  37. Hoder, K., Bjørner, N.: Generalized property directed reachability. In: Cimatti, A., Sebastiani, R. (eds.) SAT 2012. LNCS, vol. 7317, pp. 157–171. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31612-8_13

    Chapter  Google Scholar 

  38. Hofstadter, D.R., et al.: Gödel, Escher, Bach. An eternal golden braid, vol. 20. Basic books New York (1979)

    Google Scholar 

  39. Hojjat, H., Rümmer, P.: The ELDARICA horn solver. In: Formal Methods in Computer Aided Design (FMCAD), pp. 1–7. IEEE (2018)

    Google Scholar 

  40. Ivancic, F., et al.: DC2: a framework for scalable, scope-bounded software verification. In: IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 133–142 (2011)

    Google Scholar 

  41. Koc, C.K., Acar, T., Kaliski, B.S.: Analyzing and comparing montgomery multiplication algorithms. IEEE micro 16(3), 26–33 (1996)

    Article  Google Scholar 

  42. Komuravelli, A., Gurfinkel, A., Chaki, S.: Smt-based model checking for recursive programs. Formal Methods Syst. Des. 48(3), 175–205 (2016)

    Article  Google Scholar 

  43. Lahiri, S.K., McMillan, K.L., Sharma, R., Hawblitzel, C.: Differential assertion checking. In: Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pp. 345–355. ACM (2013)

    Google Scholar 

  44. Lal, A., Qadeer, S., Lahiri, S.K.: A solver for reachability modulo theories. In: Proceedings of the International Conference on Computer Aided Verification (CAV), pp. 427–443 (2012)

    Google Scholar 

  45. Livshits, V.B., Nori, A.V., Rajamani, S.K., Banerjee, A.: Merlin: specification inference for explicit information flow problems. ACM Sigplan Not. 44(6), 75–86 (2009)

    Article  Google Scholar 

  46. McMillan, K.L.: Interpolation and SAT-based model checking. In: Hunt, W.A., Somenzi, F. (eds.) CAV 2003. LNCS, vol. 2725, pp. 1–13. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45069-6_1

    Chapter  Google Scholar 

  47. McMillan, K.L.: Lazy annotation for program testing and verification. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 104–118. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14295-6_10

    Chapter  Google Scholar 

  48. McMillan, K.L.: Lazy annotation revisited. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 243–259. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08867-9_16

    Chapter  Google Scholar 

  49. McMillan, K.L., Rybalchenko, A.: Solving constrained horn clauses using interpolation. Tech. Rep. MSR-TR-2013-6 (2013)

    Google Scholar 

  50. de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78800-3_24

    Chapter  Google Scholar 

  51. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer-Verlag (1999)

    Google Scholar 

  52. Pick, L., Fedyukovich, G., Gupta, A.: Unbounded Procedure Summaries from Bounded Environments (2020). https://cs.princeton.edu/%7Eaartig/papers/clover-vmcai21-extended.pdf

  53. Pick, L., Fedyukovich, G., Gupta, A.: Automating modular verification of secure information flow. In: FMCAD. TU Wien Academic Press, pp. 158–168. IEEE (2020)

    Google Scholar 

  54. Ramanathan, M.K., Grama, A., Jagannathan, S.: Static specification inference using predicate mining. ACM SIGPLAN Not. 42(6), 123–134 (2007)

    Article  Google Scholar 

  55. Reps, T.W., Horwitz, S., Sagiv, S.: Precise interprocedural dataflow analysis via graph reachability. In: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 49–61. ACM (1995)

    Google Scholar 

  56. Satake, Y., Kashifuku, T., Unno, H.: PCSat: Predicate constraint satisfaction (2019). https://chc-comp.github.io/2019/chc-comp19.pdf

  57. Sharir, M., Pnueli, A.: Two Approaches to Interprocedural Data Flow Analysis. In: Program Flow Analysis: Theory and Applications, pp. 189–233 (1981)

    Google Scholar 

  58. Shoham, S., Yahav, E., Fink, S., Pistoia, M.: Static specification mining using automata-based abstractions. In: ISSTA, pp. 174–184. ACM (2007)

    Google Scholar 

  59. Stump, A., Sutcliffe, G., Tinelli, C.: StarExec: a cross-community infrastructure for logic solving. In: Demri, S., Kapur, D., Weidenbach, C. (eds.) IJCAR 2014. LNCS (LNAI), vol. 8562, pp. 367–373. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08587-6_28

    Chapter  Google Scholar 

  60. Unno, H., Torii, S., Sakamoto, H.: Automating induction for solving horn clauses. In: Majumdar, R., Kunčak, V. (eds.) CAV 2017. LNCS, vol. 10427, pp. 571–591. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-63390-9_30

    Chapter  Google Scholar 

  61. Yang, J., Evans, D., Bhardwaj, D., Bhat, T., Das, M.: Perracotta: mining temporal API rules from imperfect traces. In: Proceedings of the 28th International Conference on Software Engineering, pp. 282–291. ACM (2006)

    Google Scholar 

  62. Zhu, H., Magill, S., Jagannathan, S.: A data-driven CHC solver. ACM SIGPLAN Not. 53(4), 707–721 (2018)

    Article  Google Scholar 

Download references

Acknowledgements

This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE-1656466. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. This work was supported in part by the National Science Foundation award FMitF 1837030.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lauren Pick .

Editor information

Editors and Affiliations

Appendices

A Renaming and Unfolding

Here, a formula f ranging over variables v is denoted f(v). For example, a procedure body is encoded by some formula \( body_p(in_p, out_p, local_p) \) and a path within it is encoded by some formula \( \pi _p(in_p, out_p, local_p) \).

Definition 14 (Renaming)

Given a set of program paths \(\varPi ({v}, {y}, {x})\) that contain the statement \(\ell :{y} := p({x})\), the renaming of a formula \(\varPi _p({ in }, { out }, { locs })\) that represents a subset of all paths in procedure p is defined as follows:

where \( fresh ({v}, {x}, {y})\) is a vector of fresh variables not present already in v, x, or y.

Definition 15 (Unfolding)

Let \(\ell \) be a location at which procedure p is called. Given set of program paths \(\varPi \) that all go through location \(\ell \), an unfolding of p is a one-level inlining at location \(\ell \) of one of the control-flow paths \(\pi _p\) in the body of p:

$$\pi (v,x,y)[p(x,y) \mapsto rename (\{\pi _p\}, \varPi (v,x,y), \ell )]$$

B Full Set of Derivation Rules

figure d
figure e
figure f
figure g
figure h
figure i
figure j
figure k
figure l
figure m
figure n
figure o
figure p

C Heuristics

1.1 C.1 Prioritizing Choice of Node

The Verify procedure from Fig. 1 employs a heuristic to choose which node in the set A to call ProcessNode on next. The factors that contribute toward an node’s priority are as follows, with ties in one factor being broken by the next factor, where \( depth (n)\) denotes the depth of node n in D and \( previous (n)\) denotes the number of times that the node n has been chosen previously:

  • A lower \(\alpha * depth (n) + \beta * previous (n)\) score gives higher priority, where \(\alpha \) and \(\beta \) are weights

  • A lower call graph depth of \( proc (n)\) gives higher priority

  • A later call location \( ctx (n). loc \) gives higher priority

We prioritize nodes n with lower \( depth (n)\) values because they are more likely to help propagate learned summaries up to the \( main \) procedure’s callees. This priority is moderated by the \( previous (n)\) score which should prevent the starvation of nodes with larger \( depth (n)\) values. Our current heuristic search is more BFS-like, but for some examples, a DFS-like search is better. We plan to improve our heuristics in future work.

1.2 C.2 Avoiding Redundant Queries

If we have previously considered a node n that we are now processing, we can avoid making the same queries that we have previously made. E.g., if none of the over-approximate summaries for any of the procedures in \( bctx (n). env \) nor any of over-approximate summaries for any of the procedures called by \( proc (n)\) have been updated since the last time n was processed, we do not need to redo the over-over check.

1.3 C.3 Learning Over-approximate Bodies

Although there are many existing methods to interpolate, in many cases they are useless (recall our motivating example where an interpolant is just \(\top \)). To improve our chances of learning a refinement for an over-approximate summary, whenever we apply one of the proof rules that involves over-approximating the procedure body (e.g., OO, UO, OOIL, UOIL), we ensure that we at least learn the result of over-approximating the procedure body as an over-approximate fact about that procedure. For example, if we consider doing this for OO, we would simply replace premise \(O' = O[p \mapsto O[p] \wedge \mathbb {I}]\) with \(O' = O[p \mapsto O[p] \wedge \mathbb {I} \wedge \exists locals _p . \widehat{ body }_O]\). Note that the result of applying quantifier elimination to \(\mathbb {I} \wedge \exists locals _p . \widehat{ body }_O\) is also an interpolant. Similarly, if we consider doing this for OOIL, we replace the goal \(D, O, U, L', P \vdash Res \) with \(D, O[p \mapsto \exists locals _p . \widehat{ body }_O], U, L', P \vdash Res \).

1.4 C.4 Preventing Summaries from Growing too Large

Although we want to increase our chances of learning useful refinements of over-approximations as we have just discussed, we still wish to prevent summaries from becoming too complicated. We can achieve this in a few ways.

Quantifier Elimination. One way that we can achieve this is to use quantifier elimination or an approximation thereof on each conjunct (resp. disjunct) that we add to an over- (resp. under-) approximate summary. For example, we can replace \(U' = U[p \mapsto U[p] \vee \exists locals _p. \pi ]\) with \(U' = U[p \mapsto U[p] \vee \mathrm {QE}(\exists locals _p. \pi )]\) in the UU rule. We illustrate how to do this using two examples:

  • Instead of using premise \(O' = O[p \mapsto O[p] \wedge \mathbb {I} \wedge \exists locals _p . \widehat{ body }_O]\) for the OO rule as just discussed, we use the following premise: \(O' = O[p \mapsto O[p] \wedge \mathbb {I} \wedge \mathrm {QE}(\exists locals _p . \widehat{ body }_O)]\)

  • We can also apply this to properties we learn by induction. Instead of using the premise \(L' = L \cup \{ \forall vars (A) . \bigwedge A \Rightarrow (p( in , out ) \Rightarrow indProp )\) for rule OOIL, use the following premise: \(L' = L \cup \{ \forall vars (A) . \bigwedge A \Rightarrow (p( in , out ) \Rightarrow QE(indProp) )\)

  • Replace premise \(U' = U[p \mapsto U[p] \vee \exists locals _p. \pi ]\) with \(U' = U[p \mapsto U[p] \vee \mathrm {QE}(\exists locals _p. \pi )]\) in the UU rule.

This use of \(\mathrm {QE}\) leads to quantifier-free summaries.

When we update over- (resp. under-) approximate summaries, we can use over- (resp. under-) approximate \(\mathrm {QE}\). By comparison, under- (resp. over-) approximate \(\mathrm {QE}\) would lead to unsoundness. Approximating \(\mathrm {QE}\) is not only cheaper but can also further simplify the resulting summary.

Selective Updates. We can also prevent summaries from growing too quickly syntactically by only performing semantic updates. For example, consider O from the goal of the OO rule and \(O'\) from its subgoal. If \(O[p] \Rightarrow O'[p]\), then although \(O'[p]\) contains more conjuncts than O[p], it does not provide any new information. In this case, we avoid the update and simply use O in the subgoal instead of \(O'\). Similarly, if we consider U from the goal of UU and \(U'\) from its subgoal, then we only want to update the under-approximation if we have that \(U'[p] \not \Rightarrow U[p]\). Over-approximate summaries become monotonically more constrained, so if \(O[p] \Rightarrow O'[p]\), then \(O[p] \Leftrightarrow O'[p]\) must hold. Under-approximations become monotonically less constrained.

D Addition of Nodes in Derivation Tree

figure q

The AddNodes procedure is shown in Algorithm 3. For every path \(\pi \) through \( body_{proc(n)} \), it calls procedure

\(\textsc {TryAddNode}(n, \pi , p, \ell , Goal )\), which tries to apply AN to \( Goal \) with premises \(n \in A\) (AVAIL), path \(\pi \) in \( body \) (PATH), and procedure call to \(p = proc (n') \in P\) at location \(\ell \) in \(\pi \) (CALL). If TryAddNode succeeds in applying AN, then it updates \( Goal \) to be the subgoal of the application and returns \( true \). If it fails, then it performs no updates and returns \( false \). If TryAddNode fails, then there is already a node \(n''\) in D with the same bounded environment that the new node \(n'\) would have. In this case, AddNodes calls MakeAvailableIfNew, which applies MA if either of the following hold:

  • \(n''\) has never been processed before

  • \(n''\) has previously been processed with summaries \(O_ prev \) and \(U_ prev \) and the body \( body \) of \( proc(n) \) or the bounded environment \( benv \) for \(n''\) has a different over- or under-approximation than before, i.e., \(\widehat{ body }_{M_ prev } \ne \widehat{ body }_M\) or else \(\widehat{ benv }_{M_ prev } \ne \widehat{ benv }_M\) for \(M \in \{O, U\}\)

Similarly to TryAddNode, the procedure

\(\textsc {MakeAvailableIfNew}(n, \pi , p, \ell , Goal )\) applies MA with premises \(n \in D.N\) (NODE), path \(\pi \) in \( body \) (PATH), and procedure call to \( proc (n') \in P\) at location \(\ell \) in \(\pi \) (CALL). Both TryAddNode and MakeAvailableIfNew have the side-effect of updating \( Goal \) to be the subgoal of the applied rule (if any).

E Correctness and Progress Proof Sketches

Theorem 3 (Correctness)

Algorithm 1 returns \( safe \) (resp. \( unsafe \)) only if main’s semantics are such that it never violates the assertion (resp. a path in main violates the assertion).

Proof

The over-approximate summaries O in every proof subgoal are guaranteed to be such that for any procedure \(p \in P\), the semantics of p, given by interpreted predicate \(R_p( in , out )\), imply O[p] (see Definition 3), so approximation \(\widehat{m}_O\) contains at least all of the behaviors of the main procedure. The proof rule SAFE can only be applied when \(\widehat{m}_O \Rightarrow \bot \), i.e., when the over-approximate summary of main’s body does not violate the assertion along any path, indicating that the actual semantics of main also cannot violate the assertion. Similarly, the under-approximate summaries U in every proof subgoal are guaranteed to be such that for any \(p \in P\), U[p] imply \(R_p( in , out )\), so the approximation \(\widehat{m}_U\) only contains behaviors that are behaviors of the main procedure. The proof rule UNSAFE can only be applied when \(\widehat{m}_U \Rightarrow \top \), i.e., when the under-approximation of main violates the assertion along some path, which thus indicates that the actual semantics of main also includes assertion-violating behaviors.

Theorem 4 (Progress)

Processing a node in the derivation tree leads to at least one new (non-redundant) query.

Proof

Initially, no nodes in A have been processed, and after a node is processed, it is removed from the derivation tree. The only way that a node can be processed and not have a new query made about it is if an already-processed node is re-added A and this node does not have a new query that can be made about it. The AddNodes and MakeUnavailable procedures are the only ones that add nodes to A. The AddNodes procedure, by definition, will only add a node to A if there is a new query that can be made about it. MakeUnavailable only adds bounded parents of nodes whose summaries were updated. For any such bounded parent, at least one approximation of its procedure’s body must be different than it was the last time the bounded parent was processed, since one of its callee’s summaries was updated.

F Additional Experimental Results

Fig. 9.
figure 9

Timing results for the Real-World benchmarks. Points below the diagonal line are those for which Clover outperforms the corresponding tool. Points on the right edge indicate timeouts of the corresponding tool.

Fig. 10.
figure 10

Timing results for the Mutual Recursion benchmarks. Points below the diagonal line are those for which Clover outperforms the corresponding tool. Points on the right edge indicate timeouts of the corresponding tool. Points on the top edge indicate a timeout for Clover.

Figures 9 and  10 compare timing results for other tools against Clover for Real-World and Mutual Recursion benchmarks.

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Pick, L., Fedyukovich, G., Gupta, A. (2021). Unbounded Procedure Summaries from Bounded Environments. In: Henglein, F., Shoham, S., Vizel, Y. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2021. Lecture Notes in Computer Science(), vol 12597. Springer, Cham. https://doi.org/10.1007/978-3-030-67067-2_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-67067-2_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-67066-5

  • Online ISBN: 978-3-030-67067-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics