Almost Every Simply Typed \(\lambda \)-Term Has a Long \(\beta \)-Reduction Sequence

  • Ryoma Sin’ya
  • Kazuyuki Asada
  • Naoki Kobayashi
  • Takeshi Tsukada
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10203)

Abstract

It is well known that the length of a \(\beta \)-reduction sequence of a simply typed \(\lambda \)-term of order \(k\) can be huge; it is as large as \(k\)-fold exponential in the size of the \(\lambda \)-term in the worst case. We consider the following relevant question about quantitative properties, instead of the worst case: how many simply typed \(\lambda \)-terms have very long reduction sequences? We provide a partial answer to this question, by showing that asymptotically almost every simply typed \(\lambda \)-term of order \(k\) has a reduction sequence as long as \((k-2)\)-fold exponential in the term size, under the assumption that the arity of functions and the number of variables that may occur in every subterm are bounded above by a constant. The work has been motivated by quantitative analysis of the complexity of higher-order model checking.

References

  1. 1.
    Beckmann, A.: Exact bounds for lengths of reductions in typed lambda-calculus. J. Symb. Logic 66(3), 1277–1285 (2001)MathSciNetCrossRefMATHGoogle Scholar
  2. 2.
    David, R., Grygiel, K., Kozic, J., Raffalli, C., Theyssier, G., Zaionc, M.: Asymptotically almost all \(\lambda \)-terms are strongly normalizing. Logical Method Comput. Sci. 9(2) (2013)Google Scholar
  3. 3.
    Grygiel, K., Lescanne, P.: Counting and generating lambda terms. J. Funct. Program. 23(05), 594–628 (2013)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Bendkowski, M., Grygiel, K., Lescanne, P., Zaionc, M.: A natural counting of lambda terms. In: Freivalds, R.M., Engels, G., Catania, B. (eds.) SOFSEM 2016. LNCS, vol. 9587, pp. 183–194. Springer, Heidelberg (2016). doi:10.1007/978-3-662-49192-8_15 CrossRefGoogle Scholar
  5. 5.
    Knapik, T., Niwiński, D., Urzyczyn, P.: Higher-order pushdown trees are easy. In: Nielsen, M., Engberg, U. (eds.) FoSSaCS 2002. LNCS, vol. 2303, pp. 205–222. Springer, Heidelberg (2002). doi:10.1007/3-540-45931-6_15 CrossRefGoogle Scholar
  6. 6.
    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
  7. 7.
    Kobayashi, N.: Model-checking higher-order functions. In: Proceedings of PPDP 2009, pp. 25–36. ACM Press (2009)Google Scholar
  8. 8.
    Broadbent, C.H., Kobayashi, N.: Saturation-based model checking of higher-order recursion schemes. In: Proceedings of CSL 2013, vol. 23, pp. 129–148. LIPIcs (2013)Google Scholar
  9. 9.
    Ramsay, S., Neatherway, R., Ong, C.H.L.: An abstraction refinement approach to higher-order model checking. In: Proceedings of POpPL 2014 (2014)Google Scholar
  10. 10.
    Kobayashi, N.: Types and higher-order recursion schemes for verification of higher-order programs. ACM SIGPLAN Not. 44, 416–428 (2009). ACM PressCrossRefMATHGoogle Scholar
  11. 11.
    Kobayashi, N., Sato, R., Unno, H.: Predicate abstraction and CEGAR for higher-order model checking. ACM SIGPLAN Not. 46, 222–233 (2011). ACM PressCrossRefGoogle Scholar
  12. 12.
    Ong, C.H.L., Ramsay, S.: Verifying higher-order programs with pattern-matching algebraic data types. ACM SIGPLAN Not. 46, 587–598 (2011). ACM PressCrossRefMATHGoogle Scholar
  13. 13.
    Sato, R., Unno, H., Kobayashi, N.: Towards a scalable software model checker for higher-order programs. In: Proceedings of PEpPM 2013, pp. 53–62. ACM Press (2013)Google Scholar
  14. 14.
    Terui, K.: Semantic evaluation, intersection types and complexity of simply typed lambda calculus. In: 23rd International Conference on Rewriting Techniques and Applications (RTA 2012), vol. 15, pp. 323–338. LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2012)Google Scholar
  15. 15.
    Mairson, H.G.: Deciding ML typability is complete for deterministic exponential time. In: POPL, pp. 382–401. ACM Press (1990)Google Scholar
  16. 16.
    Kfoury, A.J., Tiuryn, J., Urzyczyn, P.: ML typability is dexptime-complete. In: Arnold, A. (ed.) CAAP 1990. LNCS, vol. 431, pp. 206–220. Springer, Heidelberg (1990). doi:10.1007/3-540-52590-4_50 Google Scholar
  17. 17.
    Sin’ya, R., Asada, K., Kobayashi, N., Tsukada, T.: Almost every simply typed \(\lambda \)-term has a long \(\beta \)-reduction sequence ( full version). http://www-kb.is.s.u-tokyo.ac.jp/ryoma/papers/fossacs17full.pdf
  18. 18.
    Heintze, N., McAllester, D.: Linear-time subtransitive control flow analysis. ACM SIGPLAN Not. 32, 261–272 (1997)CrossRefGoogle Scholar
  19. 19.
    Flajolet, P., Sedgewick, R.: Analytic Combinatorics, 1st edn. Cambridge University Press, New York (2009)CrossRefMATHGoogle Scholar
  20. 20.
    Goldreich, O.: Computational Complexity: A Conceptual Perspective. Cambridge University Press, Cambridge (2008)CrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  • Ryoma Sin’ya
    • 1
  • Kazuyuki Asada
    • 1
  • Naoki Kobayashi
    • 1
  • Takeshi Tsukada
    • 1
  1. 1.The University of TokyoTokyoJapan

Personalised recommendations