Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Danvy, O., Filinski, A.: Representing control: A study of the CPS transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)
Earl, C., Might, M., Horn, D.V.: Pushdown control-flow analysis of higher-order programs. CoRR abs/1007.4268 (2010)
Fähndrich, M., Rehof, J.: Type-based flow analysis and context-free language reachability. Mathematical Structures in Computer Science 18(5), 823–894 (2008)
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)
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)
Kobayashi, N.: Model-checking higher-order functions. In: Proceedings of PPDP 2009, pp. 25–36. ACM Press (2009)
Kobayashi, N.: TRecS: A type-based model checker for recursion schemes (2009), http://www.kb.ecei.tohoku.ac.jp/~koba/trecs/
Kobayashi, N.: Types and higher-order recursion schemes for verification of higher-order programs. In: Proceedings of POPL, pp. 416–428 (2009)
Kobayashi, N.: Model checking higher-order programs. Submitted for publication. A revised and extended version of [9] and [7] (2010), http://www.kb.ecei.tohoku.ac.jp/~koba/papers/hmc.pdf
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)
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)
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)
Kobayashi, N., Sato, R., Unno, H.: Predicate abstraction and CEGAR for higher-order model checking. In: Proceedings of PLDI (2011)
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)
Lester, M.M., Neatherway, R.P., Ong, C.-H.L., Ramsay, S.J.: THORS hammer (2011), http://mjolnir.cs.ox.ac.uk/thors
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)
Mossin, C.: Exact flow analysis. Mathematical Structures in Computer Science 13(1), 125–156 (2003)
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)
Ong, C.-H.L., Tzevelekos, N.: Functional reachability. In: Proceedings of LICS, pp. 286–295. IEEE Computer Society (2009)
Plotkin, G.D.: Call-by-name, call-by-value and the lambda-calculus. Theoretical Computer Science 1(2), 125–159 (1975)
Prabhu, T., Ramalingam, S., Might, M., Hall, M.W.: EigenCFA: accelerating flow analysis with gpus. In: Proceedings of POPL, pp. 511–522 (2011)
Shivers, O.: Control-Flow Analysis of Higher-Order Languages. Ph.D. thesis, Carnegie-Mellon University (May 1991)
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)
Vardoulakis, D., Shivers, O.: CFA2: a context-free approach to control-flow analysis. Logical Methods in Computer Science 7(2) (2011)
Vardoulakis, D., Shivers, O.: Pushdown flow analysis of first-class control. In: Proceedings of ICFP, pp. 69–80. ACM Press (2011)
Wright, A.K., Jagannathan, S.: Polymorphic splitting: An effective polyvariant flow analysis. TOPLAS 20(1), 166–207 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Tobita, Y., Tsukada, T., Kobayashi, N. (2012). Exact Flow Analysis by Higher-Order Model Checking. In: Schrijvers, T., Thiemann, P. (eds) Functional and Logic Programming. FLOPS 2012. Lecture Notes in Computer Science, vol 7294. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-29822-6_22
Download citation
DOI: https://doi.org/10.1007/978-3-642-29822-6_22
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-29821-9
Online ISBN: 978-3-642-29822-6
eBook Packages: Computer ScienceComputer Science (R0)