Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

On Decidable and Undecidable Extensions of Simply Typed Lambda Calculus

Published: 09 January 2025 Publication History

Abstract

The decidability of the reachability problem for finitary PCF has been used as a theoretical basis for fully automated verification tools for functional programs. The reachability problem, however, often becomes undecidable for a slight extension of finitary PCF with side effects, such as exceptions, algebraic effects, and references, which hindered the extension of the above verification tools for supporting functional programs with side effects. In this paper, we first give simple proofs of the undecidability of four extensions of finitary PCF, which would help us understand and analyze the source of undecidability. We then focus on an extension with references, and give a decidable fragment using a type system. To our knowledge, this is the first non-trivial decidable fragment that features higher-order recursive functions containing reference cells.

References

[1]
Thomas Ball, Byron Cook, Vladimir Levin, and Sriram K. Rajamani. 2004. SLAM and Static Driver Verifier: Technology Transfer of Formal Methods inside Microsoft. In Integrated Formal Methods, 4th International Conference, IFM 2004, Canterbury, UK, April 4-7, 2004, Proceedings, Eerke A. Boiten, John Derrick, and Graeme Smith (Eds.) (Lecture Notes in Computer Science, Vol. 2999). Springer, 1–20. https://doi.org/10.1007/978-3-540-24756-2_1
[2]
Thomas Ball, Rupak Majumdar, Todd D. Millstein, and Sriram K. Rajamani. 2001. Automatic Predicate Abstraction of C Programs. In Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, USA, June 20-22, 2001, Michael Burke and Mary Lou Soffa (Eds.). ACM, 203–213. https://doi.org/10.1145/378795.378846
[3]
Thomas Ball and Sriram K. Rajamani. 2002. The SLAM project: debugging system software via static analysis. In Conference Record of POPL 2002: The 29th SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Portland, OR, USA, January 16-18, 2002, John Launchbury and John C. Mitchell (Eds.). ACM, 1–3. https://doi.org/10.1145/503272.503274
[4]
Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala, and Rupak Majumdar. 2007. The software model checker Blast. Int. J. Softw. Tools Technol. Transf., 9, 5-6 (2007), 505–525. https://doi.org/10.1007/S10009-007-0044-Z
[5]
John Boyland. 2003. Checking Interference with Fractional Permissions. In Static Analysis, 10th International Symposium, SAS 2003, San Diego, CA, USA, June 11-13, 2003, Proceedings, Radhia Cousot (Ed.) (Lecture Notes in Computer Science, Vol. 2694). Springer, 55–72. https://doi.org/10.1007/3-540-44898-5_4
[6]
Christopher H. Broadbent, Arnaud Carayol, Matthew Hague, and Olivier Serre. 2012. A Saturation Method for Collapsible Pushdown Systems. In Automata, Languages, and Programming - 39th International Colloquium, ICALP 2012, Warwick, UK, July 9-13, 2012, Proceedings, Part II, Artur Czumaj, Kurt Mehlhorn, Andrew M. Pitts, and Roger Wattenhofer (Eds.) (Lecture Notes in Computer Science, Vol. 7392). Springer, 165–176. https://doi.org/10.1007/978-3-642-31585-5_18
[7]
Christopher H. Broadbent and Naoki Kobayashi. 2013. Saturation-Based Model Checking of Higher-Order Recursion Schemes. In Computer Science Logic 2013 (CSL 2013), CSL 2013, September 2-5, 2013, Torino, Italy, Simona Ronchi Della Rocca (Ed.) (LIPIcs, Vol. 23). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 129–148. https://doi.org/10.4230/LIPICS.CSL.2013.129
[8]
Xavier Denis, Jacques-Henri Jourdan, and Claude Marché. 2022. Creusot: A Foundry for the Deductive Verification of Rust Programs. In Formal Methods and Software Engineering - 23rd International Conference on Formal Engineering Methods, ICFEM 2022, Madrid, Spain, October 24-27, 2022, Proceedings, Adrián Riesco and Min Zhang (Eds.) (Lecture Notes in Computer Science, Vol. 13478). Springer, 90–105. https://doi.org/10.1007/978-3-031-17244-1_6
[9]
Susanne Graf and Hassen Saïdi. 1997. Construction of Abstract State Graphs with PVS. In Computer Aided Verification, 9th International Conference, CAV ’97, Haifa, Israel, June 22-25, 1997, Proceedings, Orna Grumberg (Ed.) (Lecture Notes in Computer Science, Vol. 1254). Springer, 72–83. https://doi.org/10.1007/3-540-63166-6_10
[10]
Daniel Hillerström and Sam Lindley. 2018. Shallow Effect Handlers. In Programming Languages and Systems - 16th Asian Symposium, APLAS 2018, Wellington, New Zealand, December 2-6, 2018, Proceedings, Sukyoung Ryu (Ed.) (Lecture Notes in Computer Science, Vol. 11275). Springer, 415–435. https://doi.org/10.1007/978-3-030-02768-1_22
[11]
Guilhem Jaber. 2020. SyTeCi: automating contextual equivalence for higher-order programs with references. Proc. ACM Program. Lang., 4, POPL (2020), 59:1–59:28. https://doi.org/10.1145/3371127
[12]
Neil D. Jones and Steven S. Muchnick. 1978. The Complexity of Finite Memory Programs with Recursion. J. ACM, 25, 2 (1978), 312–321. https://doi.org/10.1145/322063.322074
[13]
Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2018. RustBelt: securing the foundations of the rust programming language. Proc. ACM Program. Lang., 2, POPL (2018), 66:1–66:34. https://doi.org/10.1145/3158154
[14]
Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2021. Safe systems programming in Rust. Commun. ACM, 64, 4 (2021), 144–152. https://doi.org/10.1145/3418295
[15]
Naoki Kobayashi. 2009. Model-checking higher-order functions. In Proceedings of the 11th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, September 7-9, 2009, Coimbra, Portugal, António Porto and Francisco Javier López-Fraguas (Eds.). ACM, 25–36. https://doi.org/10.1145/1599410.1599415
[16]
Naoki Kobayashi. 2009. Types and higher-order recursion schemes for verification of higher-order programs. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009, Savannah, GA, USA, January 21-23, 2009, Zhong Shao and Benjamin C. Pierce (Eds.). ACM, 416–428. https://doi.org/10.1145/1480881.1480933
[17]
Naoki Kobayashi. 2011. A Practical Linear Time Algorithm for Trivial Automata Model Checking of Higher-Order Recursion Schemes. In Foundations of Software Science and Computational Structures - 14th International Conference, FOSSACS 2011, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2011, Saarbrücken, Germany, March 26-April 3, 2011. Proceedings, Martin Hofmann (Ed.) (Lecture Notes in Computer Science, Vol. 6604). Springer, 260–274. https://doi.org/10.1007/978-3-642-19805-2_18
[18]
Naoki Kobayashi. 2013. Model Checking Higher-Order Programs. J. ACM, 60, 3 (2013), 20:1–20:62. https://doi.org/10.1145/2487241.2487246
[19]
Naoki Kobayashi. 2024. On Decidable and Undecidable Extensions of Simply Typed Lambda Calculus. https://doi.org/10.48550/arXiv.2411.06086 arxiv:2411.06086. A longer version
[20]
Naoki Kobayashi, Ryosuke Sato, and Hiroshi Unno. 2011. Predicate abstraction and CEGAR for higher-order model checking. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, Mary W. Hall and David A. Padua (Eds.). ACM, 222–233. https://doi.org/10.1145/1993498.1993525
[21]
Naoki Kobayashi, Naoshi Tabuchi, and Hiroshi Unno. 2010. Higher-order multi-parameter tree transducers and recursion schemes for program verification. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, January 17-23, 2010, Manuel V. Hermenegildo and Jens Palsberg (Eds.). ACM, 495–508. https://doi.org/10.1145/1706299.1706355
[22]
Ugo Dal Lago and Alexis Ghyselen. 2024. On Model-Checking Higher-Order Effectful Programs. Proc. ACM Program. Lang., 8, POPL (2024), 2610–2638. https://doi.org/10.1145/3632929
[23]
Mark Lillibridge. 1999. Unchecked Exceptions Can Be Strictly More Powerful Than Call/CC. High. Order Symb. Comput., 12, 1 (1999), 75–104. https://doi.org/10.1023/A:1010020917337
[24]
Yusuke Matsushita, Takeshi Tsukada, and Naoki Kobayashi. 2021. RustHorn: CHC-based Verification for Rust Programs. ACM Trans. Program. Lang. Syst., 43, 4 (2021), 15:1–15:54. https://doi.org/10.1145/3462205
[25]
Marvin Lee Minsky. 1967. Computation: Finite and infinite Machines. Prentice-Hall.
[26]
Andrzej S. Murawski. 2005. About the undecidability of program equivalence in finitary languages with state. ACM Trans. Comput. Log., 6, 4 (2005), 701–726. https://doi.org/10.1145/1094622.1094626
[27]
Andrzej S. Murawski. 2005. Functions with local state: Regularity and undecidability. Theor. Comput. Sci., 338, 1-3 (2005), 315–349. https://doi.org/10.1016/J.TCS.2004.12.036
[28]
Andrzej S. Murawski. 2008. Reachability Games and Game Semantics: Comparing Nondeterministic Programs. In Proceedings of the Twenty-Third Annual IEEE Symposium on Logic in Computer Science, LICS 2008, 24-27 June 2008, Pittsburgh, PA, USA. IEEE Computer Society, 353–363. https://doi.org/10.1109/LICS.2008.24
[29]
Andrzej S. Murawski, C.-H. Luke Ong, and Igor Walukiewicz. 2005. Idealized Algol with Ground Recursion, and DPDA Equivalence. In Automata, Languages and Programming, 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, July 11-15, 2005, Proceedings, Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung (Eds.) (Lecture Notes in Computer Science, Vol. 3580). Springer, 917–929. https://doi.org/10.1007/11523468_74
[30]
Andrzej S. Murawski and Igor Walukiewicz. 2005. Third-Order Idealized Algol with Iteration Is Decidable. In Foundations of Software Science and Computational Structures, 8th International Conference, FOSSACS 2005, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2005, Edinburgh, UK, April 4-8, 2005, Proceedings, Vladimiro Sassone (Ed.) (Lecture Notes in Computer Science, Vol. 3441). Springer, 202–218. https://doi.org/10.1007/978-3-540-31982-5_13
[31]
Takashi Nakayama, Yusuke Matsushita, Ken Sakayori, Ryosuke Sato, and Naoki Kobayashi. 2024. Borrowable Fractional Ownership Types for Verification. In Verification, Model Checking, and Abstract Interpretation - 25th International Conference, VMCAI 2024, London, United Kingdom, January 15-16, 2024, Proceedings, Part II, Rayna Dimitrova, Ori Lahav, and Sebastian Wolff (Eds.) (Lecture Notes in Computer Science, Vol. 14500). Springer, 224–246. https://doi.org/10.1007/978-3-031-50521-8_11
[32]
C.-H. Luke Ong. 2004. An approach to deciding the observational equivalence of Algol-like languages. Ann. Pure Appl. Log., 130, 1-3 (2004), 125–171. https://doi.org/10.1016/J.APAL.2003.12.006
[33]
C.-H. Luke Ong. 2006. On Model-Checking Trees Generated by Higher-Order Recursion Schemes. In 21th IEEE Symposium on Logic in Computer Science (LICS 2006), 12-15 August 2006, Seattle, WA, USA, Proceedings. IEEE Computer Society, 81–90. https://doi.org/10.1109/LICS.2006.38
[34]
C.-H. Luke Ong and Steven J. Ramsay. 2011. Verifying higher-order functional programs with pattern-matching algebraic data types. In Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, January 26-28, 2011, Thomas Ball and Mooly Sagiv (Eds.). ACM, 587–598. https://doi.org/10.1145/1926385.1926453
[35]
C.-H. Luke Ong and Nikos Tzevelekos. 2009. Functional Reachability. In Proceedings of the 24th Annual IEEE Symposium on Logic in Computer Science, LICS 2009, 11-14 August 2009, Los Angeles, CA, USA. IEEE Computer Society, 286–295. https://doi.org/10.1109/LICS.2009.48
[36]
A. M. Pitts and I. D. B. Stark. 1999. Operational reasoning for functions with local state. Cambridge University Press, USA. 227–274. isbn:0521631688
[37]
Gordon D. Plotkin and Matija Pretnar. 2013. Handling Algebraic Effects. Log. Methods Comput. Sci., 9, 4 (2013), https://doi.org/10.2168/LMCS-9(4:23)2013
[38]
Steven J. Ramsay, Robin P. Neatherway, and C.-H. Luke Ong. 2014. A type-directed abstraction refinement approach to higher-order model checking. In The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’14, San Diego, CA, USA, January 20-21, 2014, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 61–72. https://doi.org/10.1145/2535838.2535873
[39]
Ryosuke Sato, Hiroshi Unno, and Naoki Kobayashi. 2013. Towards a scalable software model checker for higher-order programs. In Proceedings of the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation, PEPM 2013, Rome, Italy, January 21-22, 2013, Elvira Albert and Shin-Cheng Mu (Eds.). ACM, 53–62. https://doi.org/10.1145/2426890.2426900
[40]
John Toman, Ren Siqi, Kohei Suenaga, Atsushi Igarashi, and Naoki Kobayashi. 2020. ConSORT: Context- and Flow-Sensitive Ownership Refinement Types for Imperative Programs. In Programming Languages and Systems - 29th European Symposium on Programming, ESOP 2020, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2020, Dublin, Ireland, April 25-30, 2020, Proceedings, Peter Müller (Ed.) (Lecture Notes in Computer Science, Vol. 12075). Springer, 684–714. https://doi.org/10.1007/978-3-030-44914-8_25
[41]
Takeshi Tsukada and Naoki Kobayashi. 2014. Complexity of Model-Checking Call-by-Value Programs. In Foundations of Software Science and Computation Structures - 17th International Conference, FOSSACS 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014, Proceedings, Anca Muscholl (Ed.) (Lecture Notes in Computer Science, Vol. 8412). Springer, 180–194. https://doi.org/10.1007/978-3-642-54830-7_12

Index Terms

  1. On Decidable and Undecidable Extensions of Simply Typed Lambda Calculus

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image Proceedings of the ACM on Programming Languages
      Proceedings of the ACM on Programming Languages  Volume 9, Issue POPL
      January 2025
      2363 pages
      EISSN:2475-1421
      DOI:10.1145/3554321
      Issue’s Table of Contents
      This work is licensed under a Creative Commons Attribution International 4.0 License.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 09 January 2025
      Published in PACMPL Volume 9, Issue POPL

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Simply-typed lambda calculus
      2. references
      3. undecidability

      Qualifiers

      • Research-article

      Funding Sources

      • Japan Society for the Promotion of Science

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • 0
        Total Citations
      • 87
        Total Downloads
      • Downloads (Last 12 months)87
      • Downloads (Last 6 weeks)87
      Reflects downloads up to 26 Jan 2025

      Other Metrics

      Citations

      View Options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Login options

      Full Access

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media