Extend CMTT with Mutable References Beyond Two Stages

Extend contextual modal type theory with mutable references beyond two levels of staging while preserving scope safety and a sound type system.

Background

The paper develops a compilation from a two-level calculus with environment classifiers and mutable references to a two-level calculus based on contextual modal type theory. The target calculus combines contextual modal types with polymorphic contexts, mutable references, first-class substitutions, and reference proxies.

The authors explicitly restrict both calculi to two levels because extending contextual modal type theory with mutable references to more than two staging levels has not been solved. Such an extension would generalize the scope-safety guarantees and metatheoretic results established for the two-level setting.

References

Both and are restricted to two levels, because going beyond two levels with mutable references in CMTT is an open problem.

— Compiling Environment Classifiers to Contextual Modal Types  (2610.25741 - Chen et al., 19 Oct 2026) in Section 1, Introduction (paragraph beginning “This paper: compiling from EC to CMTT.”)