Skip to main content

Predicate Abstraction and CEGAR for \(\nu \mathrm {HFL}_\mathbb {Z}\) Validity Checking

  • Conference paper
  • First Online:
Static Analysis (SAS 2020)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12389))

Included in the following conference series:

Abstract

We propose an automated method for \(\nu \mathrm {HFL}_\mathbb {Z}\) validity checking. \(\mathrm {HFL}_{\mathbb {Z}}\) is an extension of the higher-order fixpoint logic HFL with integers, and \(\nu \mathrm {HFL}_\mathbb {Z}\) is a restriction of it to the fragment without the least fixpoint operator. The validity checking problem for \(\mathrm {HFL}_{\mathbb {Z}}\) has recently been shown to provide a uniform approach to higher-order program verification. The restriction to \(\nu \mathrm {HFL}_\mathbb {Z}\) studied in this paper already provides an automated method for a large class of program verification problems including safety and non-termination verification, and also serves as a key building block for solving the validity checking problem for full \(\mathrm {HFL}_{\mathbb {Z}}\) . Our approach is based on predicate abstraction and counterexample-guided abstraction refinement (CEGAR). We have implemented the proposed method, and applied it to program verification. According to experiments, our tool outperforms a closely related tool called Horus in terms of precision, and is competitive with a more specialized program verification tool called MoCHi despite the generality of our approach.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • 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

Notes

  1. 1.

    Kobayashi et al. [13] actually considered model checking problems, but it is actually sufficient to consider validity checking problems for formulas without modal operators, as shown in a follow-up paper [23]; thus, throughout this paper, we shall consider only validity checking for formulas without modal operators.

  2. 2.

    It is possible to further extend \(\mathrm {HFL}_{\mathbb {Z}}\) with other data structures such as lists and trees, and extend our predicate abstraction method accordingly, as long as the background solvers (such as SMT and CHC solvers) support them.

  3. 3.

    In contrast, the existential quantifier over integers is not definable in this logic.

  4. 4.

    We can prove the validity of \((\lambda x.\lambda k.k(x+x))1\,(\lambda r.r\ge 2)\) if we use a different abstraction type, like \(x\mathbin {:}\mathtt {int}[\,]\rightarrow (r\mathbin {:}\mathtt {int}[r\ge 2x]\rightarrow \bullet )\rightarrow \bullet \) for \(\lambda x.\lambda k.k(x+x)\).

  5. 5.

    More precisely there exists a formula and \( \varphi ' =_{\beta \eta } [(b_{x \le 0} \wedge b_{x \ge 0})/b_{x=0}]\varphi \).

  6. 6.

    Note that the case where both \( x \le 0 \) and \( x \ge 0 \) hold (i.e. \(x=0\)) is not problematic because of monotonicity: if \( [\mathtt {true}/b_{x \le 0}, \mathtt {false}/b_{x \ge 0}]\varphi \) is true, then \( [\mathtt {true}/b_{x \le 0}, \mathtt {true}/b_{x \ge 0}]\varphi \) is true as well.

  7. 7.

    This is not the case for full \(\mathrm {HFL}_{\mathbb {Z}}\) .

  8. 8.

    This procedure does not terminate in general. An example is \( \mathtt {false}\rhd (\nu f. \lambda x. f\,x)\,0 \).

  9. 9.

    Existential quantifiers that arise from the original programs have been replaced with finite disjunctions.

References

  1. Ball, T., Majumdar, R., Millstein, T.D., Rajamani, S.K.: Automatic predicate abstraction of C programs. In: Burke, M., Soffa, M.L. (eds.) Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, USA, 20–22 June 2001, pp. 203–213. ACM (2001). https://doi.org/10.1145/378795.378846

  2. Burn, T.C., Ong, C.L., Ramsay, S.J.: Higher-order constrained horn clauses for verification. Proc. ACM Program. Lang. 2(POPL), 11:1–11:28 (2018). https://doi.org/10.1145/3158099

  3. Champion, A., Chiba, T., Kobayashi, N., Sato, R.: ICE-based refinement type discovery for higher-order functional programs. J. Autom. Reason. (2010, to appear). A preliminary summary appeared in Proceedings of TACAS 2018

    Google Scholar 

  4. Champion, A., Chiba, T., Kobayashi, N., Sato, R.: ICE-based refinement type discovery for higher-order functional programs. In: Beyer, D., Huisman, M. (eds.) TACAS 2018. LNCS, vol. 10805, pp. 365–384. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89960-2_20

    Chapter  Google Scholar 

  5. Hashimoto, K., Unno, H.: Refinement type inference via horn constraint optimization. In: Blazy, S., Jensen, T. (eds.) SAS 2015. LNCS, vol. 9291, pp. 199–216. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-48288-9_12

    Chapter  Google Scholar 

  6. Hosoi, Y., Kobayashi, N., Tsukada, T.: A type-based HFL model checking algorithm. In: Lin, A.W. (ed.) APLAS 2019. LNCS, vol. 11893, pp. 136–155. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-34175-6_8

    Chapter  Google Scholar 

  7. Iwayama, N., Kobayashi, N., Suzuki, R., Tsukada, T.: Predicate abstraction and CEGAR for \(\nu {\rm HFL}{\mathbb{Z}}\) validity checking (2020). A long version of this paper. https://www.kb.is.s.u-tokyo.ac.jp/~koba/papers/sas2020-long.pdf

  8. Kobayashi, N.: HorSat2: a saturation-based model checker for higher-order recursion schemes (2015). https://www.kb.is.s.u-tokyo.ac.jp/~koba/horsat2/

  9. Kobayashi, N., Lozes, É., Bruse, F.: On the relationship between higher-order recursion schemes and higher-order fixpoint logic. In: Castagna, G., Gordon, A.D. (eds.) Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, 18–20 January 2017, pp. 246–259. ACM (2017)

    Google Scholar 

  10. Kobayashi, N., Nishikawa, T., Igarashi, A., Unno, H.: Temporal verification of programs via first-order fixpoint logic. In: Chang, B.-Y.E. (ed.) SAS 2019. LNCS, vol. 11822, pp. 413–436. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-32304-2_20

    Chapter  Google Scholar 

  11. Kobayashi, N., Sato, R., Unno, H.: Predicate abstraction and CEGAR for higher-order model checking. In: Hall, M.W., Padua, D.A. (eds.) Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, 4–8 June 2011, pp. 222–233. ACM (2011). https://doi.org/10.1145/1993498.1993525

  12. Kobayashi, N., Tsukada, T., Watanabe, K.: Higher-order program verification via HFL model checking. CoRR abs/1710.08614 (2017). http://arxiv.org/abs/1710.08614

  13. Kobayashi, N., Tsukada, T., Watanabe, K.: Higher-order program verification via HFL model checking. In: Ahmed, A. (ed.) ESOP 2018. LNCS, vol. 10801, pp. 711–738. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89884-1_25

    Chapter  Google Scholar 

  14. Kuwahara, T., Sato, R., Unno, H., Kobayashi, N.: Predicate abstraction and CEGAR for disproving termination of higher-order functional programs. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9207, pp. 287–303. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21668-3_17

    Chapter  Google Scholar 

  15. 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 

  16. Ong, C.L., Wagner, D.: HoCHC: a refutationally complete and semantically invariant system of higher-order logic modulo theories. In: 34th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2019, Vancouver, BC, Canada, 24–27 June 2019, pp. 1–14. IEEE (2019). https://doi.org/10.1109/LICS.2019.8785784

  17. Sato, R., Iwayama, N., Kobayashi, N.: Combining higher-order model checking with refinement type inference. In: Hermenegildo, M.V., Igarashi, A. (eds.) Proceedings of the 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM@POPL 2019, Cascais, Portugal, 14–15 January 2019, pp. 47–53. ACM (2019). https://doi.org/10.1145/3294032.3294081

  18. Sato, R., Unno, H., Kobayashi, N.: Towards a scalable software model checker for higher-order programs. In: Albert, E., Mu, S. (eds.) Proceedings of the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation, PEPM 2013, Rome, Italy, 21–22 January 2013, pp. 53–62. ACM (2013). https://doi.org/10.1145/2426890.2426900

  19. Terauchi, T.: Dependent types from counterexamples. In: Hermenegildo, M.V., Palsberg, J. (eds.) Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, 17–23 January 2010, pp. 119–130. ACM (2010). https://doi.org/10.1145/1706299.1706315

  20. Unno, H., Kobayashi, N.: Dependent type inference with interpolants. In: Porto, A., López-Fraguas, F.J. (eds.) Proceedings of the 11th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, Coimbra, Portugal, 7–9 September 2009, pp. 277–288. ACM (2009). https://doi.org/10.1145/1599410.1599445

  21. Unno, H., Satake, Y., Terauchi, T.: Relatively complete refinement type system for verification of higher-order non-deterministic programs. Proc. ACM Program. Lang. 2(POPL), 12:1–12:29 (2018). https://doi.org/10.1145/3158100

  22. Viswanathan, M., Viswanathan, R.: A higher order modal fixed point logic. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 512–528. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-28644-8_33

    Chapter  Google Scholar 

  23. Watanabe, K., Tsukada, T., Oshikawa, H., Kobayashi, N.: Reduction from branching-time property verification of higher-order programs to HFL validity checking. In: Hermenegildo, M.V., Igarashi, A. (eds.) Proceedings of the 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM@POPL 2019, Cascais, Portugal, 14–15 January 2019, pp. 22–34. ACM (2019). https://doi.org/10.1145/3294032.3294077

  24. Zhu, H., Jagannathan, S.: Compositional and lightweight dependent type inference for ML. In: Giacobazzi, R., Berdine, J., Mastroeni, I. (eds.) VMCAI 2013. LNCS, vol. 7737, pp. 295–314. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-35873-9_19

    Chapter  MATH  Google Scholar 

  25. Zhu, H., Nori, A.V., Jagannathan, S.: Learning refinement types. In: Fisher, K., Reppy, J.H. (eds.) Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming, ICFP 2015, Vancouver, BC, Canada, 1–3 September 2015, pp. 400–411. ACM (2015). https://doi.org/10.1145/2784731.2784766

  26. Zhu, H., Petri, G., Jagannathan, S.: Automatically learning shape specifications. In: Krintz, C., Berger, E. (eds.) Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2016, Santa Barbara, CA, USA, 13–17 June 2016, pp. 491–507. ACM (2016). https://doi.org/10.1145/2908080.2908125

Download references

Acknowledgments

We would like to thank anonymous referees for useful comments. This work was supported by JSPS KAKENHI Grant Number JP15H05706, JP20H00577 and JP20H05703.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Naoki Kobayashi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Iwayama, N., Kobayashi, N., Suzuki, R., Tsukada, T. (2020). Predicate Abstraction and CEGAR for \(\nu \mathrm {HFL}_\mathbb {Z}\) Validity Checking. In: Pichardie, D., Sighireanu, M. (eds) Static Analysis. SAS 2020. Lecture Notes in Computer Science(), vol 12389. Springer, Cham. https://doi.org/10.1007/978-3-030-65474-0_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-65474-0_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-65473-3

  • Online ISBN: 978-3-030-65474-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics