Exact Flow Analysis by Higher-Order Model Checking

  • Yoshihiro Tobita
  • Takeshi Tsukada
  • Naoki Kobayashi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7294)


We propose a novel control flow analysis for higher-order functional programs, based on a reduction to higher-order model checking. The distinguished features of our control flow analysis are that, unlike most of the control flow analyses like k-CFA, it is exact for simply-typed (λ)-calculus with recursion and finite base types, and that, unlike Mossin’s exact flow analysis, it is indeed runnable in practice, at least for small programs. Furthermore, under certain (arguably strong) assumptions, our control flow analysis runs in time cubic in the size of a program. We formalize the reduction of control flow analysis to higher-order model checking, prove the correctness, and report preliminary experiments.


Model Check Type Unit Source Program Reduction Sequence Recursion Scheme 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Blume, M., Acar, U.A., Chae, W.: Exception Handlers as Extensible Cases. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 273–289. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  2. 2.
    Danvy, O., Filinski, A.: Representing control: A study of the CPS transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)MathSciNetzbMATHCrossRefGoogle Scholar
  3. 3.
    Earl, C., Might, M., Horn, D.V.: Pushdown control-flow analysis of higher-order programs. CoRR abs/1007.4268 (2010)Google Scholar
  4. 4.
    Fähndrich, M., Rehof, J.: Type-based flow analysis and context-free language reachability. Mathematical Structures in Computer Science 18(5), 823–894 (2008)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Hague, M., Murawski, A., Ong, C.-H.L., Serre, O.: Collapsible pushdown automata and recursion schemes. In: Proceedings of 23rd Annual IEEE Symposium on Logic in Computer Science, pp. 452–461. IEEE Computer Society (2008)Google Scholar
  6. 6.
    Heintze, N., McAllester, D.: Linear-time subtransitive control flow analysis. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 261–272 (1997)Google Scholar
  7. 7.
    Kobayashi, N.: Model-checking higher-order functions. In: Proceedings of PPDP 2009, pp. 25–36. ACM Press (2009)Google Scholar
  8. 8.
    Kobayashi, N.: TRecS: A type-based model checker for recursion schemes (2009),
  9. 9.
    Kobayashi, N.: Types and higher-order recursion schemes for verification of higher-order programs. In: Proceedings of POPL, pp. 416–428 (2009)Google Scholar
  10. 10.
    Kobayashi, N.: Model checking higher-order programs. Submitted for publication. A revised and extended version of [9] and [7] (2010),
  11. 11.
    Kobayashi, N.: A Practical Linear Time Algorithm for Trivial Automata Model Checking of Higher-Order Recursion Schemes. In: Hofmann, M. (ed.) FOSSACS 2011. LNCS, vol. 6604, pp. 260–274. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  12. 12.
    Kobayashi, N.: Exact flow analysis by higher-order model checking. In: Schrijvers, T., Thiemann, P. (eds.) FLOPS 2012. LNCS, vol. 7294, pp. 275–289. Springer, Heidelberg (2012)Google Scholar
  13. 13.
    Kobayashi, N., Ong, C.-H.L.: Complexity of Model Checking Recursion Schemes for Fragments of the Modal Mu-Calculus. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds.) ICALP 2009. LNCS, vol. 5556, pp. 223–234. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  14. 14.
    Kobayashi, N., Sato, R., Unno, H.: Predicate abstraction and CEGAR for higher-order model checking. In: Proceedings of PLDI (2011)Google Scholar
  15. 15.
    Kobayashi, N., Tabuchi, N., Unno, H.: Higher-order multi-parameter tree transducers and recursion schemes for program verification. In: Proceedings of POPL, pp. 495–508 (2010)Google Scholar
  16. 16.
    Lester, M.M., Neatherway, R.P., Ong, C.-H.L., Ramsay, S.J.: THORS hammer (2011),
  17. 17.
    Meyer, A.R., Wand, M.: Continuation Semantics in Typed Lambda-calculi (Summary). In: Parikh, R. (ed.) Logic of Programs 1985. LNCS, vol. 193, pp. 219–224. Springer, Heidelberg (1985)CrossRefGoogle Scholar
  18. 18.
    Mossin, C.: Exact flow analysis. Mathematical Structures in Computer Science 13(1), 125–156 (2003)MathSciNetzbMATHCrossRefGoogle Scholar
  19. 19.
    Ong, C.-H.L.: On model-checking trees generated by higher-order recursion schemes. In: LICS 2006, pp. 81–90. IEEE Computer Society Press (2006)Google Scholar
  20. 20.
    Ong, C.-H.L., Tzevelekos, N.: Functional reachability. In: Proceedings of LICS, pp. 286–295. IEEE Computer Society (2009)Google Scholar
  21. 21.
    Plotkin, G.D.: Call-by-name, call-by-value and the lambda-calculus. Theoretical Computer Science 1(2), 125–159 (1975)MathSciNetzbMATHCrossRefGoogle Scholar
  22. 22.
    Prabhu, T., Ramalingam, S., Might, M., Hall, M.W.: EigenCFA: accelerating flow analysis with gpus. In: Proceedings of POPL, pp. 511–522 (2011)Google Scholar
  23. 23.
    Shivers, O.: Control-Flow Analysis of Higher-Order Languages. Ph.D. thesis, Carnegie-Mellon University (May 1991)Google Scholar
  24. 24.
    Shivers, O.: Higher-order control-flow analysis in retrospect: Lessons learned, lessons abandoned. In: ACM SIGPLAN Notices - Best of PLDI 1979-1999, pp. 257–269 (2003)Google Scholar
  25. 25.
    Vardoulakis, D., Shivers, O.: CFA2: a context-free approach to control-flow analysis. Logical Methods in Computer Science 7(2) (2011)Google Scholar
  26. 26.
    Vardoulakis, D., Shivers, O.: Pushdown flow analysis of first-class control. In: Proceedings of ICFP, pp. 69–80. ACM Press (2011)Google Scholar
  27. 27.
    Wright, A.K., Jagannathan, S.: Polymorphic splitting: An effective polyvariant flow analysis. TOPLAS 20(1), 166–207 (1998)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Yoshihiro Tobita
    • 1
  • Takeshi Tsukada
    • 1
  • Naoki Kobayashi
    • 1
  1. 1.Tohoku UniversityJapan

Personalised recommendations