Bookmark

OpenURL

Abstract

In this paper we introduce a new approach to formalizing certain type operations in type theory. Traditionally, many type constructors in type theory are independently axiomatized and the correctness of these axioms is argued semantically. In this paper we introduce a notion of an “image ” of a given type under a mapping that captures the spirit of many of such semantical arguments. This allows us to use the new “image ” type to formalize within the type theory a large range of type constructors that were traditionally formalized via postulated axioms. We demonstrate the ability of the “image ” constructor to express “forgetful ” types by using it to formalize the “squash ” and “set ” type constructors. We also demonstrate its ability to handle types with non-trivial equality relations by using it to formalize the union type operator. We demonstrate the ability of the “image ” constructor to express certain inductive types by showing how the type of lists and a higher-order abstract syntax type can be naturally formalized using the new type constructor. The work presented in this paper have been implemented in the MetaPRL proof assistant and all the derivations checked by MetaPRL.

Citations

...ented here focuses on the NuPRL type theory [7] and its variations, including the MetaPRL implementation [12] oftheNuPRL type theory. NuPRL type theory in an extension of the Martin-Löf’s type theory =-=[15, 16]-=-, which differs from many other type theories in its treatment of equality. In Coq’s Calculus of Constructions, for example, there is a single global equality relation which is not the desired one for...

...oach where most exotic terms are eliminated, but those that are extensionally equal to the real ones remain) or would require special modalities that would allow expressing restricted function spaces =-=[9]-=-. With the image type constructor, however, it is possible to define the Term type so that there are no “exotic” terms in it. It turns out that if one formalizes the deBruijn representation of the λ-e...

...ddition to the four judgments of the Martin-Löf theory listed in Section 1.1, theNuPRL type theory also includes the following one: a ∼ b a and b are computationally equal This computational equality =-=[14]-=- is a transitive symmetric closure of a relation that includes both purely computational relations (such as beta reduction) and definitional equalities. In NuPRL type theory a term may be replaced wit...

... (2006) 121–132 123 1.3 PER Models of Type Theory The most commonly used semantics of the NuPRL type theory (and some other type theories as well) is the PER (partial equivalence relations) semantics =-=[21, 2, 1]-=-. In PER semantics each type is identified with a set of objects (often — a set of closed terms) together with an equivalence relation on that set that serves as an equality relation for objects (clos...

...irst element projection. From this definition we were able to derive all the rules that are traditionally postulated with this type constructor. 3.3 Deriving the Union Type Constructor The union type =-=[20]-=-, denoted � B[x], is the least common supertype of B[x]’s for x:A x ∈ A. It contains all elements of types B[x]. The equivalence relation of the � B[x] isthetransitive closure of the union of the equi...

... (2006) 121–132 123 1.3 PER Models of Type Theory The most commonly used semantics of the NuPRL type theory (and some other type theories as well) is the PER (partial equivalence relations) semantics =-=[21, 2, 1]-=-. In PER semantics each type is identified with a set of objects (often — a set of closed terms) together with an equivalence relation on that set that serves as an equality relation for objects (clos...

...atically checked, while the semantical arguments are informal, written on paper, and can only be checked manually. The work presented in this paper has been implemented in the MetaPRL proof assistant =-=[10, 11, 13]-=- and all the derivations were checked by MetaPRL. This paper is structured as follows. In Section 2 we will introduce the “Image” type constructor, define its meaning in the PER semantics, present the...

...never applying destructors. The traditional approaches to formalizing such Higher-Order Abstract Syntax types would either result in types where some “exotic” terms are left in the type (for example, =-=[8]-=- defines an approach where most exotic terms are eliminated, but those that are extensionally equal to the real ones remain) or would require special modalities that would allow expressing restricted ...

...ved. And once these problems are solved and the “Image” type is defined, it turns out this constructor allows capturing an essential feature of the PER semantics for the type theory. It is well known =-=[3, 4, 5]-=- that there is a common theme to the standard type constructors and their axiomatization in type theory. When a new type constructor is added to the theory, there is usually a standard pattern to defi...

... to adequately formalize in a NuPRL-style type theory (and a number of other type theories as well). The latter implementation is a much more involved one, and we will only give a brief overview. See =-=[19]-=- for a detailed description and extensive discussion of using the image type constructor for reasoning about syntax. 4.1 Example: The List Type The A List type is the type of all the finite lists of t...

...ented here focuses on the NuPRL type theory [7] and its variations, including the MetaPRL implementation [12] oftheNuPRL type theory. NuPRL type theory in an extension of the Martin-Löf’s type theory =-=[15, 16]-=-, which differs from many other type theories in its treatment of equality. In Coq’s Calculus of Constructions, for example, there is a single global equality relation which is not the desired one for...

...ved. And once these problems are solved and the “Image” type is defined, it turns out this constructor allows capturing an essential feature of the PER semantics for the type theory. It is well known =-=[3, 4, 5]-=- that there is a common theme to the standard type constructors and their axiomatization in type theory. When a new type constructor is added to the theory, there is usually a standard pattern to defi...

...ved. And once these problems are solved and the “Image” type is defined, it turns out this constructor allows capturing an essential feature of the PER semantics for the type theory. It is well known =-=[3, 4, 5]-=- that there is a common theme to the standard type constructors and their axiomatization in type theory. When a new type constructor is added to the theory, there is usually a standard pattern to defi...

...atically checked, while the semantical arguments are informal, written on paper, and can only be checked manually. The work presented in this paper has been implemented in the MetaPRL proof assistant =-=[10, 11, 13]-=- and all the derivations were checked by MetaPRL. This paper is structured as follows. In Section 2 we will introduce the “Image” type constructor, define its meaning in the PER semantics, present the...

...pe theories by postulated axioms can now be derived using the new type constructor. 3.1 Deriving the Squash Type Constructor Our type theory used to contain a primitive type constructor called squash =-=[7, 17]-=-. The squash type [A] “forgets” the witnesses of A. For any type A, thetype[A] (“squashed A” or “hidden A”) is empty if and only if A is empty and contains a single canonical element • when A is inhab...