We investigate a simply typed modal $\lambda$-calculus,
$\lambda^{\to\square}$, due to Pfenning, Wong and Davies, where we define a
well-typed term with respect to a context stack that captures the possible
world semantics in a syntactic way. It provides logical foundation for
multi-staged meta-programming. Our main contribution in this paper is a
normalization by evaluation (NbE) algorithm for $\lambda^{\to\square}$ which we
prove sound and complete. The NbE algorithm is a moderate extension to the
standard presheaf model of simply typed $\lambda$-calculus. However, central to
the model construction and the NbE algorithm is the observation of Kripke-style
substitutions on context stacks which brings together two previously separate
concepts, structural modal transformations on context stacks and substitutions
for individual assumptions. Moreover, Kripke-style substitutions allow us to
give a formulation for contextual types, which can represent open code in a
meta-programming setting. Our work lays the foundation for extending the
logical foundation by Pfenning, Wong, and Davies towards building a practical,
dependently typed foundation for meta-programming.
This technical report investigates Kripke-style modal type theories, both simply typed and dependently typed. We examine basic meta-theories of the type theories, develop their substitution calculi, and give normalization by evaluation algorithms.
Dependent Object Types (DOT) is a calculus with path dependent types, intersection types, and object selfreferences, which serves as the core calculus of Scala 3. Although the calculus has been proven sound, it remains open whether type checking in DOT is decidable. In this paper, we establish undecidability proofs of type checking and subtyping of D <: , a syntactic subset of DOT. It turns out that even for D <: , undecidability is surprisingly difficult to show, as evidenced by counterexamples for past attempts. To prove undecidability, we discover an equivalent definition of the D <: subtyping rules in normal form. Besides being easier to reason about, this definition makes the phenomenon of subtyping reflection explicit as a single inference rule. After removing this rule, we discover two decidable fragments of D <: subtyping and identify algorithms to decide them. We prove soundness and completeness of the algorithms with respect to the fragments, and we prove that the algorithms terminate. Our proofs are mechanized in a combination of Coq and Agda. CCS Concepts: • Theory of computation → Type theory; • Software and its engineering → Functional languages.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.