On Decidable and Undecidable Extensions of Simply Typed Lambda Calculus
Naoki Kobayashi
TL;DR
The paper analyzes the reachability problem in extensions of the simply typed lambda calculus (finitary PCF). It proves undecidability for four side-effect extensions (exceptions, algebraic effects with handlers, symbol generation, and Boolean references) by encoding Minsky machines, illustrating the source of undecidability. It then introduces a decidable fragment, PCF^{ref, lin}_{eta}, that restricts closures to linear ownership of references and provides a type-based translation to pure PCF, establishing decidability for the Boolean base and enabling automated verification via existing higher-order model-checkers. The work further discusses extensions (fractional ownerships, borrowing, product/sum types, higher-order references) and reports preliminary experiments translating OCaml-like programs, highlighting practical applications to verification tools like MoCHi. Overall, the results inform language design and verification tooling by balancing expressiveness with decidability through ownership-conscious type systems.
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.
