Reachability is Decidable for ATM-Typable Finitary PCF with Effect Handlers

📅 2025-08-17
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper investigates the decidability of reachability for effectful programs in finite PCF under the Answer-Type Modification (ATM) type system. We introduce a type-directed continuation-passing style (CPS) transformation that semantically preserves effectful, ATM-typable programs by converting them into equivalent effect-free finite PCF programs—thereby restoring reachability decidability. Our key contributions are threefold: (1) the first proof that reachability is decidable for ATM-typable, effect-handling finite PCF programs; (2) the discovery that ATM not only enables decidability but also inadvertently excludes certain non-terminating programs, revealing a deep duality between type enhancement and program behavior; and (3) the correction of erroneous claims in prior work. These results establish a novel foundation for formal verification of effectful programs.

Technology Category

Application Category

📝 Abstract
It is well known that the reachability problem for simply-typed lambda calculus with recursive definitions and finite base-type values (finitary PCF) is decidable. A recent paper by Dal Lago and Ghyselen has shown that the same problem becomes undecidable when the language is extended with algebraic effect and handlers (effect handlers). We show that, perhaps surprisingly, the problem becomes decidable even with effect handlers when the type system is extended with answer type modification (ATM). A natural intuition may find the result contradictory, because one would expect allowing ATM makes more programs typable. Indeed, this intuition is correct in that there are programs that are typable with ATM but not without it, as we shall show in the paper. However, a corollary of our decidability result is that the converse is true as well: there are programs that are typable without ATM but becomes untypable with ATM, and we will show concrete examples of such programs in the paper. Our decidability result is proven by a novel continuation passing style (CPS) transformation that transforms an ATM-typable finitary PCF program with effect handlers to a finitary PCF program without effect handlers. Additionally, as another application of our CPS transformation, we show that every recursive-function-free ATM-typable finitary PCF program with effect handlers terminates, while there are (necessarily ATM-untypable) recursive-function-free finitary PCF programs with effect handlers that may diverge. Finally, we disprove a claim made in a recent work that proved a similar but strictly weaker decidability result. We foresee our decidability result to lay a foundation for developing verification methods for programs with effect handlers, just as the decidability result for reachability of finitary PCF has done such for programs without effect handlers.
Problem

Research questions and friction points this paper is trying to address.

Decidability of reachability in ATM-typable finitary PCF with effect handlers
Comparison of typability with and without answer type modification (ATM)
Verification foundation for programs with effect handlers
Innovation

Methods, ideas, or system contributions that make the work stand out.

ATM-typable finitary PCF with effect handlers
Novel CPS transformation for decidability
Termination guarantee for recursive-function-free programs
🔎 Similar Papers
No similar papers found.