## Formalizing type operations using the “Image” type constructor (2006)

Venue: | Workshop on Logic, Language, Information and Computation (WoLLIC |

Citations: | 3 - 1 self |

### BibTeX

@INPROCEEDINGS{Nogin06formalizingtype,

author = {Aleksey Nogin and Alexei Kopylov},

title = {Formalizing type operations using the “Image” type constructor},

booktitle = {Workshop on Logic, Language, Information and Computation (WoLLIC},

year = {2006},

pages = {121--132},

publisher = {Elsevier}

}

### 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

281 |
Constructive mathematics and computer programming, in
- Martin-Löf
- 1982
(Show Context)
Citation Context ...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... |

125 | Primitive recursion for higher-order abstract syntax
- Schürmann, Despeyroux, et al.
(Show Context)
Citation Context ...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... |

101 | Equality in lazy computation systems
- Howe
(Show Context)
Citation Context ...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... |

56 |
A Non-Type-Theoretic Semantics for Type-Theoretic Language
- Allen
- 1987
(Show Context)
Citation Context ... (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... |

52 | Programming with intersection types, union types, and polymorphism
- Pierce
- 1991
(Show Context)
Citation Context ...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... |

33 |
A Non-type-theoretic Definition of Martin-Löf’s Types
- Allen
- 1987
(Show Context)
Citation Context ... (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... |

33 |
The MetaPRL Logical Programming Environment
- Hickey
- 2001
(Show Context)
Citation Context ...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... |

24 | Higher-Order Abstract Syntax with induction in Coq
- Despeyroux, Hirschowitz
- 1994
(Show Context)
Citation Context ...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 ... |

15 |
On the meaning and construction of the rules in Martin-Löf’s theory of types
- Backhouse
- 1987
(Show Context)
Citation Context ...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... |

12 | A computational approach to reflective meta-reasoning about languages with bindings
- Nogin, Kopylov, et al.
- 2005
(Show Context)
Citation Context ... 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... |

11 |
Intuitionistic type theory, in: Number 1
- Martin-Löf
- 1984
(Show Context)
Citation Context ...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... |

9 |
Do-it-yourself type theory, Formal Aspects of Computing 1
- Backhouse, Chisholm, et al.
- 1989
(Show Context)
Citation Context ...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... |

6 |
Do-it-yourself type theory (part I
- Backhouse, Chisholm, et al.
- 1989
(Show Context)
Citation Context ...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... |

2 |
Kopylov et al., MetaPRL home page
- Hickey, Nogin, et al.
(Show Context)
Citation Context ...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... |

1 |
Quotient types: A modular approach, in: Carreño et al
- Nogin
(Show Context)
Citation Context ...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... |

1 |
Sequent schema for derived rules, in: Carreño et al
- Nogin, Hickey
(Show Context)
Citation Context ...troduction rule: Elimination rule: Γ ⊢ A Type Γ ⊢ Img{A; x.f〈〉[x]} Type Γ ⊢ a ∈ A Γ ⊢ f[a] ∈ Img{A; x.f〈〉[x]} Γ; x : A ⊢ t ∈ T [f[x]] Γ; y : Img{A; x.f〈〉[x]} ⊢t ∈ T [y] where f〈〉[x] isasequent schema =-=[18]-=- notation prohibiting f from containing free occurrences of variables other than x. Remark 2.2 Note that the elimination rule requires the conclusion to be an equality. This has to do with the computa... |