10 research outputs found
A Categorical Normalization Proof for the Modal Lambda-Calculus
We investigate a simply typed modal -calculus,
, 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 which we
prove sound and complete. The NbE algorithm is a moderate extension to the
standard presheaf model of simply typed -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
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.
The Multiverse: Logical Modularity for Proof Assistants
Proof assistants play a dual role as programming languages and logical systems. As programming languages, proof assistants offer standard modularity mechanisms such as first-class functions, type polymorphism and modules. As logical systems, however, modularity is lacking, and understandably so: incompatible reasoning principles-such as univalence and uniqueness of identity proofs-can indirectly lead to logical inconsistency when used in a given development, even when they appear to be confined to different modules. The lack of logical modularity in proof assistants also hinders the adoption of richer programming constructs, such as effects. We propose the multiverse, a general type-theoretic approach to endow proof assistants with logical modularity. The multiverse consists of multiple universe hierarchies that statically describe the reasoning principles and effects available to define a term at a given type. We identify sufficient conditions for this structuring to modularly ensure that incompatible principles do not interfere, and to locally restrict the power of dependent elimination when necessary. This extensible approach generalizes the ad-hoc treatment of the sort of propositions in the Coq proof assistant. We illustrate the power of the multiverse by describing the inclusion of Coq-style propositions, the strict propositions of Gilbert et al., the exceptional type theory of PĂ©drot and Tabareau, and general axiomatic extensions of the logic
The Multiverse: Logical Modularity for Proof Assistants
Proof assistants play a dual role as programming languages and logical systems. As programming languages, proof assistants offer standard modularity mechanisms such as first-class functions, type polymorphism and modules. As logical systems, however, modularity is lacking, and understandably so: incompatible reasoning principles-such as univalence and uniqueness of identity proofs-can indirectly lead to logical inconsistency when used in a given development, even when they appear to be confined to different modules. The lack of logical modularity in proof assistants also hinders the adoption of richer programming constructs, such as effects. We propose the multiverse, a general type-theoretic approach to endow proof assistants with logical modularity. The multiverse consists of multiple universe hierarchies that statically describe the reasoning principles and effects available to define a term at a given type. We identify sufficient conditions for this structuring to modularly ensure that incompatible principles do not interfere, and to locally restrict the power of dependent elimination when necessary. This extensible approach generalizes the ad-hoc treatment of the sort of propositions in the Coq proof assistant. We illustrate the power of the multiverse by describing the inclusion of Coq-style propositions, the strict propositions of Gilbert et al., the exceptional type theory of PĂ©drot and Tabareau, and general axiomatic extensions of the logic
Design and Implementation of Family Polymorphism for Interactive Theorem Proving
With the growing practice of mechanizing language metatheories, it has become ever more pressing that interactive theorem provers make it easy to write reusable, extensible code and proofs.
This thesis presents a novel language design geared towards extensible metatheory mechanization in a proof assistant. The new design achieves reuse and extensibility via a form of family polymorphism, an object-oriented idea, that allows code and proofs to be polymorphic to their enclosing families. Our development addresses technical challenges that arise from the underlying language of a proof assistant being simultaneously functional, dependently typed, a logic, and an interactive tool. Our
results include (1) a prototypical implementation of the language design as a Coq plugin, (2) a dependent type theory capturing the essence of the language mechanism and its consistency and canonicity results, and (3) case studies showing how the new expressiveness naturally addresses real programming challenges in metatheory mechanization