Fragments of ML Decidable by Nested Data Class Memory Automata

Conrad Cotton-Barratt, David Hopkins, Andrzej S. Murawski, C.-h. Luke Ong

Introduction

In the field of programming language theory, observational equivalence is a fundamental property used to determine if two program fragments are interchangeable in any context without altering the system's behavior. For languages featuring local state, such as Reduced ML (RML), proving this equivalence is a complex task that is generally undecidable. This research investigates the boundary between decidable and undecidable fragments of RML, focusing on how type complexity—specifically order and arity—influences the feasibility of algorithmic verification.

Methodology: Game Semantics and Nested Automata

The authors approach the problem by mapping program behaviors to Game Semantics, where execution is modeled as a dialogue between a Proponent (the program) and an Opponent (the environment). A significant challenge in this model is the "Pointer Problem"—the need to track justification pointers that link function calls to their respective returns across nested execution threads.

Typing rules for the finitary RML language, defining the scope of the study.

To address this, the paper introduces Nested Data Class Memory Automata. These specialized automata process "data words" where symbols are associated with values from an infinite, tree-structured set. This tree structure is designed to mirror the hierarchical nature of function calls, enabling the automaton to recognize valid game plays and thus decide equivalence for specific language fragments.

Key Results and the Decidability Boundary

The research identifies two new decidable fragments: $RML^{P-Str}_{2\vdash 1}$ and $RML^{res}_{2\vdash 1}$. The "P-Strict" fragment is particularly notable because the Proponent's pointers are uniquely determined by the move sequence, simplifying the tracking requirements. The $RML^{res}_{2\vdash 1}$ fragment maintains decidability by ensuring that function arguments are evaluated atomically (arity 1), which prevents the disruption of the automaton's tree-structured memory.

Summary of decidable, undecidable, and unknown fragments of RML.

The study also delineates the limits of decidability. As shown in the results table, the problem becomes undecidable for any third-order types, second-order types with multiple first-order arguments, or fragments incorporating recursion. These results highlight a "razor-thin" boundary where minor increases in type complexity lead to Turing-completeness and undecidability.

Limitations and Future Work

While the paper provides a theoretical breakthrough, the proposed algorithms have high computational complexity (non-primitive recursive), making them currently impractical for standard compilers. Future research will focus on more expressive automata models, potentially combining infinite-alphabet data words with visible stacks, to tackle remaining unknown fragments like $RML_X$ where partial evaluations break standard tree-structured tracking.

Summary updated

BibTeX
@inproceedings{cottonbarratt2015fragments,
  author = {Conrad Cotton-Barratt and David Hopkins and Andrzej S. Murawski and C.-H. Luke Ong},
  title = {{Fragments of ML Decidable by Nested Data Class Memory Automata}},
  booktitle = {FoSSaCS},
  year = {2015},
  url = {https://openreview.net/forum?id=Iq8iy8COVco},
}
Figure