{"title":"语境类型的范畴论视角:从简单类型到依赖类型","authors":"Jason Z. S. Hu, Brigitte Pientka, Ulrich Schöpp","doi":"https://dl.acm.org/doi/10.1145/3545115","DOIUrl":null,"url":null,"abstract":"<p>We describe the categorical semantics for a simply typed variant and a simplified dependently typed variant of <span>Cocon</span>, a contextual modal type theory where the box modality mediates between the weak function space that is used to represent higher-order abstract syntax (HOAS) trees and the strong function space that describes (recursive) computations about them. What makes <span>Cocon</span> different from standard type theories is the presence of first-class contexts and contextual objects to describe syntax trees that are closed with respect to a given context of assumptions. Following M. Hofmann’s work, we use a presheaf model to characterise HOAS trees. Surprisingly, this model already provides the necessary structure to also model <span>Cocon</span>. In particular, we can capture the contextual objects of <span>Cocon</span> using a comonad ♭ that restricts presheaves to their closed elements. This gives a simple semantic characterisation of the invariants of contextual types (e.g. substitution invariance) and identifies <span>Cocon</span> as a type-theoretic syntax of presheaf models. We further extend this characterisation to dependent types using categories with families and show that we can model a fragment of <span>Cocon</span> without recursor in the Fitch-style dependent modal type theory presented by Birkedal et al.</p>","PeriodicalId":50916,"journal":{"name":"ACM Transactions on Computational Logic","volume":null,"pages":null},"PeriodicalIF":0.7000,"publicationDate":"2022-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"A Category Theoretic View of Contextual Types: From Simple Types to Dependent Types\",\"authors\":\"Jason Z. S. Hu, Brigitte Pientka, Ulrich Schöpp\",\"doi\":\"https://dl.acm.org/doi/10.1145/3545115\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p>We describe the categorical semantics for a simply typed variant and a simplified dependently typed variant of <span>Cocon</span>, a contextual modal type theory where the box modality mediates between the weak function space that is used to represent higher-order abstract syntax (HOAS) trees and the strong function space that describes (recursive) computations about them. What makes <span>Cocon</span> different from standard type theories is the presence of first-class contexts and contextual objects to describe syntax trees that are closed with respect to a given context of assumptions. Following M. Hofmann’s work, we use a presheaf model to characterise HOAS trees. Surprisingly, this model already provides the necessary structure to also model <span>Cocon</span>. In particular, we can capture the contextual objects of <span>Cocon</span> using a comonad ♭ that restricts presheaves to their closed elements. This gives a simple semantic characterisation of the invariants of contextual types (e.g. substitution invariance) and identifies <span>Cocon</span> as a type-theoretic syntax of presheaf models. We further extend this characterisation to dependent types using categories with families and show that we can model a fragment of <span>Cocon</span> without recursor in the Fitch-style dependent modal type theory presented by Birkedal et al.</p>\",\"PeriodicalId\":50916,\"journal\":{\"name\":\"ACM Transactions on Computational Logic\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.7000,\"publicationDate\":\"2022-10-20\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"ACM Transactions on Computational Logic\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://doi.org/https://dl.acm.org/doi/10.1145/3545115\",\"RegionNum\":4,\"RegionCategory\":\"数学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM Transactions on Computational Logic","FirstCategoryId":"94","ListUrlMain":"https://doi.org/https://dl.acm.org/doi/10.1145/3545115","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
A Category Theoretic View of Contextual Types: From Simple Types to Dependent Types
We describe the categorical semantics for a simply typed variant and a simplified dependently typed variant of Cocon, a contextual modal type theory where the box modality mediates between the weak function space that is used to represent higher-order abstract syntax (HOAS) trees and the strong function space that describes (recursive) computations about them. What makes Cocon different from standard type theories is the presence of first-class contexts and contextual objects to describe syntax trees that are closed with respect to a given context of assumptions. Following M. Hofmann’s work, we use a presheaf model to characterise HOAS trees. Surprisingly, this model already provides the necessary structure to also model Cocon. In particular, we can capture the contextual objects of Cocon using a comonad ♭ that restricts presheaves to their closed elements. This gives a simple semantic characterisation of the invariants of contextual types (e.g. substitution invariance) and identifies Cocon as a type-theoretic syntax of presheaf models. We further extend this characterisation to dependent types using categories with families and show that we can model a fragment of Cocon without recursor in the Fitch-style dependent modal type theory presented by Birkedal et al.
期刊介绍:
TOCL welcomes submissions related to all aspects of logic as it pertains to topics in computer science. This area has a great tradition in computer science. Several researchers who earned the ACM Turing award have also contributed to this field, namely Edgar Codd (relational database systems), Stephen Cook (complexity of logical theories), Edsger W. Dijkstra, Robert W. Floyd, Tony Hoare, Amir Pnueli, Dana Scott, Edmond M. Clarke, Allen E. Emerson, and Joseph Sifakis (program logics, program derivation and verification, programming languages semantics), Robin Milner (interactive theorem proving, concurrency calculi, and functional programming), and John McCarthy (functional programming and logics in AI).
Logic continues to play an important role in computer science and has permeated several of its areas, including artificial intelligence, computational complexity, database systems, and programming languages.
The Editorial Board of this journal seeks and hopes to attract high-quality submissions in all the above-mentioned areas of computational logic so that TOCL becomes the standard reference in the field.
Both theoretical and applied papers are sought. Submissions showing novel use of logic in computer science are especially welcome.