## A modular type-checking algorithm for type theory with singleton types and proof irrelevance (2009)

### Cached

### Download Links

Venue: | IN TLCA’09, VOLUME 5608 OF LNCS |

Citations: | 7 - 5 self |

### BibTeX

@INPROCEEDINGS{Abel09amodular,

author = {Andreas Abel and Thierry Coquand and Miguel Pagano},

title = {A modular type-checking algorithm for type theory with singleton types and proof irrelevance},

booktitle = {IN TLCA’09, VOLUME 5608 OF LNCS},

year = {2009},

pages = {5--19},

publisher = {Springer}

}

### OpenURL

### Abstract

### Citations

711 | A framework for defining logics
- Harper, Honsel, et al.
- 1987
(Show Context)
Citation Context ...kers like Agda [46], Coq [33], and Epigram [40] is to decide if a given term has some type (either checking for a given type or inferring one); i.e., if a term corresponds to a proof of a proposition =-=[32]-=-. Hence, the convenience of such a system is, in part, determined by the types for which the system can check membership. We extend the decidability of type-checking done in previous works [2, 3] for ... |

455 | Computational lambda-calculus and monads
- Moggi
- 1989
(Show Context)
Citation Context ...well typed, since we do not have y = z : B for arbitrary z. It seems that φ Π is not definable in λ Irr , as it is not definable14 A. ABEL, T. COQUAND, AND M. PAGANO in computational lambda-calculus =-=[44]-=- for an arbitrary monad Prf. Awodey and Bauer also have only φ Π : ((x:A) → Prf B) → Prf ((x:A) → Prf B), which is trivial. For arbitrary p : (x:Prf A) × Prf B we have (ψΣ ◦ φΣ )(p) =β ([a], [b]) wher... |

405 |
LCF considered as a programming language
- Plotkin
- 1977
(Show Context)
Citation Context ...s not without subtleties. Domain theoretic functions such as application · correspond to Haskell programs if our denotational semantics is computationally adequate for Haskell’s operational semantics =-=[48]-=-. Filinski and Rhode [26] formally relate a NbE function on a 2 Let us notice here the tagging introduced by the disjoint sum operator +. Indeed, in the absence of a type structure, tagless normalisat... |

400 | Explicit substitutions
- Abadi, Cardelli, et al.
- 1991
(Show Context)
Citation Context ...pty-ctx) Γ ∈ Ctx A ∈ Type(Γ) (ext-ctx) Γ.A ∈ Ctx4 A. ABEL, T. COQUAND, AND M. PAGANO Substitutions. We have five operators for substitutions, which are the usual operators for explicit substitutions =-=[1]-=-: SS = {〈〉, ( , ), id , , p}. Semantically, substitutions σ ∈ Γ → ∆ are sequences of values, one for every variable declaration in ∆. The sequences are constructed from the empty sequence 〈〉 by sequen... |

271 |
Programming in Martin–Löf ’s Type Theory. An introduction
- Nordström, Petersson, et al.
- 1990
(Show Context)
Citation Context ...of such a system is, in part, determined by the types for which the system can check membership. We extend the decidability of type-checking done in previous works [2, 3] for Martin-Löf type theories =-=[38, 45]-=- by considering singleton types and proof-irrelevant propositions. We consider a type theory with a universe, which allows large eliminations, i.e., types defined by recursion on natural numbers. The ... |

183 | Towards a Practical Programming Language based on Dependent Type Theory
- Norell
- 2007
(Show Context)
Citation Context ...mplete type-checking algorithm for terms in normal form. We extend the results to proof-irrelevant propositions. 1. Introduction and Related Work One of the raisons d’être of proof-checkers like Agda =-=[46]-=-, Coq [33], and Epigram [40] is to decide if a given term has some type (either checking for a given type or inferring one); i.e., if a term corresponds to a proof of a proposition [32]. Hence, the co... |

148 |
Intuitionistic Type Theory. Bibliopolis
- Martin-Löf
- 1984
(Show Context)
Citation Context ...of such a system is, in part, determined by the types for which the system can check membership. We extend the decidability of type-checking done in previous works [2, 3] for Martin-Löf type theories =-=[38, 45]-=- by considering singleton types and proof-irrelevant propositions. We consider a type theory with a universe, which allows large eliminations, i.e., types defined by recursion on natural numbers. The ... |

145 |
Type systems for programming languages
- MITCHELL
- 1990
(Show Context)
Citation Context ... and · is a binary operation on A. The following definitions are standard (e.g. [10, 21]) in definitions of PER models for dependent types. The first one is even standard for non-dependent types (cf. =-=[43]-=-) and “F-bounded polymorphism” ([17]); its definition clearly shows that equality is interpreted extensionally for dependent function spaces. The second one is the PER corresponding to the interpretat... |

77 | Towards a mechanized metatheory of Standard ML
- Lee, Crary, et al.
- 2007
(Show Context)
Citation Context ... in the context of specification languages. An important use of singletons is as definitions by abbreviations (see [10, 21]); they were also used to model translucent sums in the formalisation of SML =-=[34]-=-. It is interesting to consider singleton types because beta-eta phase separation fails: one cannot do eta-expansion before beta-normalisation of types because the shape of the types at which to eta-e... |

68 | A compiled implementation of strong reduction
- Grégoire, Leroy
- 2002
(Show Context)
Citation Context ...ticle, this is deferred to future work. Untyped NbE is now given by a standard evaluator [t]ρ ∈ D of terms t in environments ρ and a readback function Rj d from values d at de Bruijn level j to terms =-=[31]-=-. For the sake of readability, we use names instead of de Bruijn indices in the syntax of untyped terms. [x]ρ = ρ(x) [r s]ρ = [[r ]ρ · [s]ρ [λx.t]ρ = Lam (d ↦→ [t]ρ[d/x]) To normalise a closed term t,... |

67 | A theory of types
- Martin-Lof
- 1971
(Show Context)
Citation Context ...propositions. We consider a type theory with a universe, which allows large eliminations, i.e., types defined by recursion on natural numbers. The universe of small types was introduced by Martin-Löf =-=[37]-=- for formalising category theory. Martin-Löf presents universes in two different styles [38]: à la Russell (the one considered here), and à la Tarski. 1998 ACM Subject Classification: F.4.1. Key words... |

66 | A general formulation of simultaneous inductive-recursive definitions in type theory
- Dybjer
(Show Context)
Citation Context ... ∈ Ne for all i ∈ N. (6) If k = k ′ ∈ Ne and d = d ′ ∈ Nf , then App k d = App k ′ d ′ ∈ Ne. We define U, T ∈ PER(D) and [ ] : dom(T ) → PER(D) using Dybjer’s schema of inductive-recursive definition =-=[25]-=-. We show then that [ ] is a family of PERs over D. Definition 5.17 (PER model). (1) Inductive definition of U ∈ PER(D). (a) Ne ⊆ U, (b) if X = X ′ ∈ U and d = d ′ ∈ [X], then Sing d X = Sing d ′ X ′ ... |

62 |
PER models of subtyping, recursive types and higher-order polymorphism
- Bruce, Mitchell
- 1992
(Show Context)
Citation Context ...he following definitions are standard (e.g. [10, 21]) in definitions of PER models for dependent types. The first one is even standard for non-dependent types (cf. [43]) and “F-bounded polymorphism” (=-=[17]-=-); its definition clearly shows that equality is interpreted extensionally for dependent function spaces. The second one is the PER corresponding to the interpretation of singleton types; it has as it... |

59 |
Generalised algebraic theories and contextual categories
- Cartmell
- 1986
(Show Context)
Citation Context ...cient, and technical difficulties are avoided. Outline. In Section 2, we first present λ Sing , Martin-Löf’s logical framework with one universe and singleton types, as a generalized algebraic theory =-=[19]-=-. Secondly, we introduce λ Irr , Martin-Löf type theory with natural numbers, sigma types, and proof-irrelevant propositions. In Section 3, we show some examples using singleton types and proof-irrele... |

54 |
An inverse of the evaluation functional for typed λ–calculus
- Berger, Schwichtenberg
- 1991
(Show Context)
Citation Context ...expressions, the semantic domain has to be equipped with variables; a major challenge in rigorous treatments of NbE has been the problem to generate fresh identifiers. Solutions include term families =-=[16]-=-, liftable de Bruijn terms [8], or Kripke semantics [5]. In this work we present a novel formulation of NbE which avoids the problem completely: reification is split into an η-expansion phase (↓) in t... |

54 |
A typed operational semantics for type theory
- Goguen
- 1994
(Show Context)
Citation Context ...rong normalization for a variant of Aspinall’s system with equality defined by reduction. He uses a typed Kripke model of strongly normalizing terms, a variant of Goguen’s typed operational semantics =-=[29]-=-. Stone and Harper [54] extend Aspinall’s framework by sigma types and eta-equality, which allows them to reduce singletons at higher types to singletons at base type. Their decision procedure is type... |

49 |
Epigram: Practical programming with dependent types
- McBride
- 2004
(Show Context)
Citation Context ...hm for terms in normal form. We extend the results to proof-irrelevant propositions. 1. Introduction and Related Work One of the raisons d’être of proof-checkers like Agda [46], Coq [33], and Epigram =-=[40]-=- is to decide if a given term has some type (either checking for a given type or inferring one); i.e., if a term corresponds to a proof of a proposition [32]. Hence, the convenience of such a system i... |

48 | Subtyping with singleton types
- Aspinall
- 1994
(Show Context)
Citation Context ...ina. LOGICAL METHODS IN COMPUTER SCIENCE DOI:10.2168/LMCS-??? c○ A. Abel, T. Coquand, and M. Pagano Creative Commons 12 A. ABEL, T. COQUAND, AND M. PAGANO Singleton types were introduced by Aspinall =-=[10]-=- in the context of specification languages. An important use of singletons is as definitions by abbreviations (see [10, 21]); they were also used to model translucent sums in the formalisation of SML ... |

45 | An algorithm for type-checking dependent types
- Coquand
- 1996
(Show Context)
Citation Context ...lues ⃗ d. The free variables are de Bruijn levels in spirit, thus, no shifting is needed, just like in the locally nameless approach [49]. The second author has given a semantics with neutrals before =-=[20]-=-, calling the free variables generic values. Also, this approach has been used by the first two authors together with Dybjer [5] for NbE without a reflection operation, and independently by Löh, McBri... |

45 |
A type-inference approach to reduction properties and semantics of polymorphic expressions
- Mitchell
- 1986
(Show Context)
Citation Context ...semantics. In this subsection we introduce the abstract notion of PER models for our theory. This subsection does not introduce any novelty (except for some notational issues). We refer the reader to =-=[42]-=- for a short report on the historical developments of PER models. Definition 5.1 (Partial Equivalence Relations). A partial equivalence relation (PER) over a set A is a binary relation over A which is... |

39 | Normalization by evaluation for typed lambda calculus with coproducts
- Altenkirch, Dybjer, et al.
- 2001
(Show Context)
Citation Context ...nt turnstiles for referring to each calculus. In Sect. 2.3 we prove that (⊢ ⋆ ) is a conservative extension of (⊢). Strong extensionality for booleans and larger enumeration sets is hard to implement =-=[9, 12]-=- and beyond the scope of this work. In the sequel we use ⃗t for denoting the n terms t0 · · · tn−1 in case n B t0 · · · tn−1 r. We will omit the superscript n in ci, and in case B ⃗t r. Proof irreleva... |

39 | Subset Coercions in Coq - Sozeau - 2007 |

38 | Internal type theory
- Dybjer
(Show Context)
Citation Context ...aic theories (GAT) [19]. A GAT consists of sort symbols and operator symbols, each with a dependent typing, and equations between sort expressions and terms (“operator expressions”). Following Dybjer =-=[24]-=-, we are using “informal syntax” where redundant arguments to operators are left implicit. 2.1. Calculus λ Sing with singleton types. We use capital Greek letters (Γ, ∆) for variables ranging over con... |

34 | Extensional equivalence and singleton types
- Stone, Harper
- 2006
(Show Context)
Citation Context ... to eta-expand is still unknown at this point; and one cannot postpone eta-expansion after beta-normalisation, because eta-expansion at singleton type can trigger new betareductions. Stone and Harper =-=[54]-=- decide type checking in a logical framework (LF) with singleton types and subtyping. Yet it is not clear whether their method extends to computation on the type level. As far as we know, our work is ... |

31 |
Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums
- Balat, Cosmo, et al.
- 2004
(Show Context)
Citation Context ...nt turnstiles for referring to each calculus. In Sect. 2.3 we prove that (⊢ ⋆ ) is a conservative extension of (⊢). Strong extensionality for booleans and larger enumeration sets is hard to implement =-=[9, 12]-=- and beyond the scope of this work. In the sequel we use ⃗t for denoting the n terms t0 · · · tn−1 in case n B t0 · · · tn−1 r. We will omit the superscript n in ci, and in case B ⃗t r. Proof irreleva... |

30 | The Implicit Calculus of Constructions as a Programming Language with Dependent Types
- Barras, Bernardo
- 2008
(Show Context)
Citation Context ...of Awodey and Bauer [11]. However, we believe that Pfenning’s proof irrelevance can be modeled via bracket types Prf A, with the weaker “monadic” rule for where (see section 2). Barras and Bernardo’s =-=[13]-=- presentation of proof irrelevant functions Γ, x : A ⊢ B Γ, x : A ⊢ t : B x ̸∈ FV(t ∗ ) Γ ⊢ λxt : (x:Prf A) → B diverges from Pfenning’s that they allow irrelevant variables x to be relevant in types ... |

30 |
Proofs and Types, volume 7 of Cambridge Tracts in Theoret Computer Science
- Girard, Lafont, et al.
- 1989
(Show Context)
Citation Context ...cks reduction. A bit sloppily, we refer to elements of Ne as “neutral terms”; in general, the attribute neutral shall mean variable in head position (this is stricter than Girard’s concept of neutral =-=[28]-=-). Definition 2.3 (Neutral terms, and normal forms). Ne ∋ k ::= vi | app k v Nf ∋ v, V, W ::= U | Fun V W | {v}V | λv | k An advantage of introducing the calculus as a GAT is that we can derive severa... |

28 | Propositions as [types
- Awodey, Bauer
- 2004
(Show Context)
Citation Context ...ion of irrelevance is implicitly handled by annotating variables to ensure proof variables (x÷A) appear only in proofs, in contrast to our explicit use of where [ ] ← in the style of Awodey and Bauer =-=[11]-=-. However, we believe that Pfenning’s proof irrelevance can be modeled via bracket types Prf A, with the weaker “monadic” rule for where (see section 2). Barras and Bernardo’s [13] presentation of pro... |

28 |
Semantics of Type Theory
- Streicher
- 1991
(Show Context)
Citation Context ...decidability for singleton types in the presence of eta by an eta-expanding translation into a logical framework with beta-equality only. He works with fully annotated terms in the sense of Streicher =-=[55]-=-. He stresses that his approach does not scale to computation on the type level. In the continuation of this work we want to investigate whether our type-checking algorithm can be simplified if we imp... |

23 | A logical framework with dependently typed records
- Coquand, Pollack, et al.
- 2003
(Show Context)
Citation Context ...2 A. ABEL, T. COQUAND, AND M. PAGANO Singleton types were introduced by Aspinall [10] in the context of specification languages. An important use of singletons is as definitions by abbreviations (see =-=[10, 21]-=-); they were also used to model translucent sums in the formalisation of SML [34]. It is interesting to consider singleton types because beta-eta phase separation fails: one cannot do eta-expansion be... |

22 | Normalization by evaluation for Martin-Löf type theory with typed equality judgements
- Abel, Coquand, et al.
- 2007
(Show Context)
Citation Context ...sition [32]. Hence, the convenience of such a system is, in part, determined by the types for which the system can check membership. We extend the decidability of type-checking done in previous works =-=[2, 3]-=- for Martin-Löf type theories [38, 45] by considering singleton types and proof-irrelevant propositions. We consider a type theory with a universe, which allows large eliminations, i.e., types defined... |

22 | Closure Under AlphaConversion
- Pollack
- 1993
(Show Context)
Citation Context ...riables xi and application of the free variables to sequences of values ⃗ d. The free variables are de Bruijn levels in spirit, thus, no shifting is needed, just like in the locally nameless approach =-=[49]-=-. The second author has given a semantics with neutrals before [20], calling the free variables generic values. Also, this approach has been used by the first two authors together with Dybjer [5] for ... |

20 |
The Implicit Calculus of Constructions
- Miquel
- 2001
(Show Context)
Citation Context ...free in the relevant parts t ∗ of t.) Barras and Bernardo justify their calculusA MODULAR TYPE-CHECKING ALGORITHM FOR TYPE THEORY 35 by erasing into Miquel’s Implicit Calculus of Constructions (ICC) =-=[41]-=-. The ICC style irrelevance seems more expressive than Awodey and Bauer’s or Pfenning’s, but the exact relationship is unclear to us. Berger’s Uniform Heyting Algebra [15] features uniform quantificat... |

18 |
Building up a toolbox for Martin-Löf’s type theory: subset theory
- Sambin, Valentini
- 1998
(Show Context)
Citation Context ...types à la PVS [51] in type-theories having the eta rule. This style of subset types was also explored by Sozeau [53, Sec. 3.3]; for another presentation of subset types in Martin-Löf type-theory see =-=[50]-=-. Berardi conjectured that (impredicative) type-theory with proof-irrelevance is equivalent to constructive mathematics [14]. Checking dependent types relies on checking types for equality. To this en... |

15 |
Pure Type Systems with Judgemental Equality
- Adams
(Show Context)
Citation Context ...lt is exploited in the next section where we introduce the type-checking algorithm. Injectivity of Fun plays a key rôle in all versions of dependent type theory with equality as judgement; cf. Adams’ =-=[7]-=- proof of equivalence between PTS with equality as a judgement and equality taken as a relation between untyped terms, improved by Siles and Herbelin [52]. Remark 6.18. By expanding definitions, we ea... |

13 | Uniform heyting arithmetic
- Berger
- 2005
(Show Context)
Citation Context ...culus of Constructions (ICC) [41]. The ICC style irrelevance seems more expressive than Awodey and Bauer’s or Pfenning’s, but the exact relationship is unclear to us. Berger’s Uniform Heyting Algebra =-=[15]-=- features uniform quantification {∀x}A (and {∃x}A) to obtain optimized programs by extraction from proofs. A proof of a uniform universal Γ ⊢ M : A Γ ⊢ {∀} + (λxM) : {∀x}A may not mention term variabl... |

12 | Verifying a semantic βη-conversion test for Martin-Löf type theory
- Abel, Coquand, et al.
- 2008
(Show Context)
Citation Context ... variables; a major challenge in rigorous treatments of NbE has been the problem to generate fresh identifiers. Solutions include term families [16], liftable de Bruijn terms [8], or Kripke semantics =-=[5]-=-. In this work we present a novel formulation of NbE which avoids the problem completely: reification is split into an η-expansion phase (↓) in the semantics, followed by a read back function (R) into... |

11 |
A syntactic approach to eta equality in type theory
- Goguen
- 2005
(Show Context)
Citation Context ... and proves its correctness in Twelf, without the need for a model construction. His purely syntactical approach does not scale to universes, since he cannot handle types defined by recursion. Goguen =-=[30]-=- follows a similar agenda, he shows decidability for singleton types in the presence of eta by an eta-expanding translation into a logical framework with beta-equality only. He works with fully annota... |

11 | A tutorial implementation of a dependently typed lambda calculus
- Löh, McBride, et al.
- 2010
(Show Context)
Citation Context ... variables generic values. Also, this approach has been used by the first two authors together with Dybjer [5] for NbE without a reflection operation, and independently by Löh, McBride, and Swierstra =-=[35]-=-. In this article, we put the technique to a novel use by defining typed reification and reflection for this semantics. 4.2. Untyped NbE. Let Var = {x0, x1, . . . } be a denumerable set of variables. ... |

10 | Operational aspects of untyped normalization by evaluation
- Aehlig, Joachimski
- 2004
(Show Context)
Citation Context ...n has to be equipped with variables; a major challenge in rigorous treatments of NbE has been the problem to generate fresh identifiers. Solutions include term families [16], liftable de Bruijn terms =-=[8]-=-, or Kripke semantics [5]. In this work we present a novel formulation of NbE which avoids the problem completely: reification is split into an η-expansion phase (↓) in the semantics, followed by a re... |

8 | On the strength of proof-irrelevant type theories
- Werner
- 2006
(Show Context)
Citation Context ... singleton types are considered together with a universe. De Bruijn proposed the concept of irrelevance of proofs [18], for reducing the burden in the formalisation of mathematics. As shown by Werner =-=[56]-=-, the use of proof-irrelevance types together with sigma types is one way to get subset types à la PVS [51] in type-theories having the eta rule. This style of subset types was also explored by Sozeau... |

7 | The interaction between category theory and set theory - Blass - 1983 |

7 | A denotational account of untyped normalization by evaluation
- Filinski, Rohde
- 2002
(Show Context)
Citation Context .... .}. When considering NbE for the untyped lambda calculus, the type semantics collapses to a single domain D ∼ = ̂ Λ + [D → D] which contains terms and functions, 2 as observed by Filinski and Rhode =-=[26]-=-. Aehlig and Joachimski [8] replace term families by functions h from natural numbers to a de Bruijn index representation of terms, where h(n) shifts all free indices by n. In this paper, instead of h... |

7 |
Simple types in type theory: Deep and shallow encodings
- Garillot, Werner
- 2007
(Show Context)
Citation Context ...be chosen fresh to avoid capture of names in the body of the function f. However, since f is a semantic object, it is a non-trivial problem to compute a name which is fresh for f. Garillot and Werner =-=[27]-=- solve it by first letting x be a dummy identifier, computing the free variables in the reified function body t, and then reify f again with a name x which is fresh for t. This is, of course, horribly... |

6 | Strong Normalization with Singleton Types - Courant - 2002 |

6 | Principles and Pragmatics of Subtyping in PVS
- Shankar, Owre
- 1999
(Show Context)
Citation Context ...proofs [18], for reducing the burden in the formalisation of mathematics. As shown by Werner [56], the use of proof-irrelevance types together with sigma types is one way to get subset types à la PVS =-=[51]-=- in type-theories having the eta rule. This style of subset types was also explored by Sozeau [53, Sec. 3.3]; for another presentation of subset types in Martin-Löf type-theory see [50]. Berardi conje... |

3 | On the algebraic foundation of proof assistants for intuitionistic type theory
- Abel, Coquand, et al.
- 2008
(Show Context)
Citation Context ...le of judgements that represent a bidirectional type checking algorithm for terms in normal form; its implementation in Haskell can be found in the appendix. The algorithm is similar to previous ones =-=[20, 4]-=-, in that it proceeds by analysing the possible types for each normal form, and succeeds only if the type’s shape matches the one required by the introduction rule of the term. The only difference is ... |

3 | A syntactic account of singleton types via hereditary substitution
- Crary
- 2009
(Show Context)
Citation Context ...ig type, it can mention the universe U, thus, we can define small types by recursion via natrec. This so called large elimination excludes normalization proofs which use induction on type expressions =-=[23, 22]-=-. We add the usual computation laws for primitive recursion. natrec B z s zero = z natrec B z s (suc t) = app (app s t) (natrec B z s t) Enumeration sets. The type Nn has the n canonical inhabitants c... |

3 | Equality is typable in semi-full pure type systems
- Siles, Herbelin
- 2010
(Show Context)
Citation Context ... theory with equality as judgement; cf. Adams’ [7] proof of equivalence between PTS with equality as a judgement and equality taken as a relation between untyped terms, improved by Siles and Herbelin =-=[52]-=-. Remark 6.18. By expanding definitions, we easily check (1) nbeΓ(Fun A B) = Fun (nbeΓ(A)) (nbeΓ.A(B)), and (2) nbeΓ({a}A) = {nbe A Γ (a)} nbeΓ(A). Corollary 6.19 (Injectivity of Fun and of { } ). If ... |

2 |
proof irrelevance in modal type theory
- Pfenning, extensionality
- 2001
(Show Context)
Citation Context ...d like to integrate subtyping in our calculus, which should not be too difficult, since the PER model already supports subtyping [10, 21]. 8.2. Related and Further Work on Proof Irrelevance. Pfenning =-=[47]-=- presents a logical framework with proof irrelevance that supports irrelevant function arguments, with function introduction rule (writing (x:Prf A) → B in our syntax): Γ, x ÷ A ⊢ B Γ, x ÷ A ⊢ t : B Γ... |