Abstract
AbstractWe introduce layering to modal type theory to combine type theory with intensional analysis. In particular, we demonstrate this idea by developing a 2-layered modal type theory. At the core of this type theory (layer 0) is a simply typed $$\lambda $$
λ
-calculus with no modality. Layer 1 is obtained by extending the core language with one layer of contextual $$\square $$
□
types to support pattern matching on potentially open code from layer 0 while retaining normalization. Although both layers fundamentally share the same language and the same typing judgment, we only allow computation at layer 1. As a consequence, layer 0 accurately captures the syntactic representation of code in contrast to the computational behaviors at layer 1. The system is justified by normalization by evaluation (NbE) using a presheaf model. The normalization algorithm extracted from the model is sound and complete and is implemented in Agda.Layered modal type theory provides a uniform foundation for meta-programming with intensional analysis. We see this work as an important step towards a foundational way to support meta-programming in proof assistants.
Publisher
Springer Nature Switzerland
Reference61 articles.
1. Abel, A.: Normalization by evaluation: dependent types and impredicativity. Habilitation thesis, Ludwig-Maximilians-Universität München (2013), https://www.cse.chalmers.se/~abela/habil.pdf
2. Abel, A., Bernardy, J.: A unified view of modalities in type systems. Proc. ACM Program. Lang. 4(ICFP), 90:1–90:28 (2020), https://doi.org/10.1145/3408972
3. Abelson, H., Sussman, G.J.: Structure and Interpretation of Computer Programs, Second Edition. MIT Press (1996)
4. Allais, G.: Scoped and typed staging by evaluation (2024), https://arxiv.org/abs/2310.13413
5. Altenkirch, T., Hofmann, M., Streicher, T.: Categorical reconstruction of a reduction free normalization proof. In: Pitt, D.H., Rydeheard, D.E., Johnstone, P.T. (eds.) Category Theory and Computer Science, 6th International Conference, CTCS ’95, Cambridge, UK, August 7-11, 1995, Proceedings. Lecture Notes in Computer Science, vol. 953, pp. 182–199. Springer (1995), https://doi.org/10.1007/3-540-60164-3_27