Results 1  10
of
19
Strongly Typed Term Representations in Coq
 J AUTOM REASONING
"... There are two approaches to formalizing the syntax of typed object languages in a proof assistant or programming language. The extrinsic approach is to first define a type that encodes untyped object expressions and then make a separate definition of typing judgements over the untyped terms. The int ..."
Abstract

Cited by 13 (2 self)
 Add to MetaCart
There are two approaches to formalizing the syntax of typed object languages in a proof assistant or programming language. The extrinsic approach is to first define a type that encodes untyped object expressions and then make a separate definition of typing judgements over the untyped terms. The intrinsic approach is to make a single definition that captures welltyped object expressions, so illtyped expressions cannot even be expressed. Intrinsic encodings are attractive and naturally enforce the requirement that metalanguage operations on object expressions, such as substitution, respect object types. The price is that the metalanguage types of intrinsic encodings and operations involve nontrivial dependency, adding significant complexity. This paper describes intrinsicstyle formalizations of both simplytyped and polymorphic languages, and basic syntactic operations thereon, in the Coq proof assistant. The Coq types encoding objectlevel variables (de Bruijn indices) and terms are indexed by both type and typing environment. One key construction is the bootstrapping of definitions and lemmas about the action of substitutions in terms of similar ones for a simpler notion of renamings. In the simplytyped case, this yields definitions that are free of any use of type equality coercions. In the polymorphic case, some substitution operations do still require type coercions, which we at least partially tame by uniform use of heterogeneous equality.
Outrageous but meaningful coincidences: Dependent typesafe syntax and evaluation
 In ACM SIGPLAN Workshop on Genetic Programming (WGP’10
, 2010
"... Tagless interpreters for welltyped terms in some object language are a standard example of the power and benefit of precise indexing in types, whether with dependent types, or generalized algebraic datatypes. The key is to reflect object language types as indices (however they may be constituted) f ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Tagless interpreters for welltyped terms in some object language are a standard example of the power and benefit of precise indexing in types, whether with dependent types, or generalized algebraic datatypes. The key is to reflect object language types as indices (however they may be constituted) for the term datatype in the host language, so that host type coincidence ensures object type coincidence. Whilst this technique is widespread for simply typed object languages, dependent types have proved a tougher nut with nontrivial computation in type equality. In their typesafe representations, Danielsson [2006] and Chapman [2009] succeed in capturing the equality rules, but at the cost of representing equality derivations explicitly within terms. This article delivers a typesafe representation for a dependently typed object language, dubbed KIPLING, whose computational type equality just appropriates that of its host, Agda. The KIPLING interpreter example is not merely de rigeur— it is key to the construction. At the heart of the technique is that key component of generic programming, the universe. 1.
Formalizing categorical models of type theory in type theory
 In International Workshop on Logical Frameworks and MetaLanguages: Theory and Practice
, 2007
"... This note is about work in progress on the topic of “internal type theory ” where we investigate the internal formalization of the categorical metatheory of constructive type theory in (an extension of) itself. The basic notion is that of a category with families, a categorical notion of model of de ..."
Abstract

Cited by 6 (2 self)
 Add to MetaCart
(Show Context)
This note is about work in progress on the topic of “internal type theory ” where we investigate the internal formalization of the categorical metatheory of constructive type theory in (an extension of) itself. The basic notion is that of a category with families, a categorical notion of model of dependent type theory. We discuss how to formalize the notion of category with families inside type theory and how to build initial categories with families. Initial categories with families will be term models which play the role of canonical syntax for dependent type theory. We also discuss the formalization of the result that categories with finite limits give rise to categories with families. This yields a typetheoretic perspective on Curien’s work on “substitution up to isomorphism”. Our formalization is being carried out in the proof assistant Agda 2 developed at Chalmers. 1
Towards Normalization by Evaluation for the βηCalculus of Constructions
"... Abstract. We consider the Calculus of Constructions with typed betaeta equality and an algorithm which computes long normal forms. The normalization algorithm evaluates terms into a semantic domain, and reifies the values back to terms in normal form. To show termination, we interpret types as part ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
Abstract. We consider the Calculus of Constructions with typed betaeta equality and an algorithm which computes long normal forms. The normalization algorithm evaluates terms into a semantic domain, and reifies the values back to terms in normal form. To show termination, we interpret types as partial equivalence relations between values and type constructors as operators on PERs. This models also yields consistency of the betaetaCalculus of Constructions. The model construction can be carried out directly in impredicative type theory, enabling a formalization in Coq. 1
A Categorical Semantics for InductiveInductive Definitions
"... Abstract. Inductioninduction is a principle for defining data types in MartinLöf Type Theory. An inductiveinductive definition consists of a set A, together with an Aindexed family B: A Ñ Set, where both A and B are inductively defined in such a way that the constructors for A can refer to B and ..."
Abstract

Cited by 4 (2 self)
 Add to MetaCart
(Show Context)
Abstract. Inductioninduction is a principle for defining data types in MartinLöf Type Theory. An inductiveinductive definition consists of a set A, together with an Aindexed family B: A Ñ Set, where both A and B are inductively defined in such a way that the constructors for A can refer to B and vice versa. In addition, the constructors for B can refer to the constructors for A. We extend the usual initial algebra semantics for ordinary inductive data types to the inductiveinductive setting by considering dialgebras instead of ordinary algebras. This gives a new and compact formalisation of inductiveinductive definitions, which we prove is equivalent to the usual formulation with elimination rules. 1
Typed syntactic metaprogramming
 International Conference on Functional Programming (ICFP
, 2013
"... We present a novel set of metaprogramming primitives for use in a dependentlytyped functional language. The types of our metaprograms provide strong and precise guarantees about their termination, correctness and completeness. Our system supports typesafe construction and analysis of terms, typ ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
(Show Context)
We present a novel set of metaprogramming primitives for use in a dependentlytyped functional language. The types of our metaprograms provide strong and precise guarantees about their termination, correctness and completeness. Our system supports typesafe construction and analysis of terms, types and typing contexts. Unlike alternative approaches, they are written in the same style as normal programs and use the language’s standard functional computational model. We formalise the new metaprogramming primitives, implement them as an extension of Agda, and provide evidence of usefulness by means of two compelling applications in the fields of datatypegeneric programming and proof tactics.
Embedding F
, 2012
"... This millennium has seen a great deal of research into embedded domainspecific languages. Primarily, such languages are simplytyped. Focusing on System F, we demonstrate how to embed polymorphic domain specific languages in Haskell and OCaml. We exploit recent language extensions including kind po ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
This millennium has seen a great deal of research into embedded domainspecific languages. Primarily, such languages are simplytyped. Focusing on System F, we demonstrate how to embed polymorphic domain specific languages in Haskell and OCaml. We exploit recent language extensions including kind polymorphism and firstclass modules.
Utrecht University and
, 2013
"... This paper presents a library for programming with polymorphic dynamic types in the dependently typed programming language Agda. The resulting library allows dynamically typed values with a polymorphic type to be instantiated to a less general (possibly monomorphic) type without compromising type s ..."
Abstract
 Add to MetaCart
(Show Context)
This paper presents a library for programming with polymorphic dynamic types in the dependently typed programming language Agda. The resulting library allows dynamically typed values with a polymorphic type to be instantiated to a less general (possibly monomorphic) type without compromising type soundness. There are situations where the types of the values that a program manipulates are not known during compilation. This is typically the case when data, or even parts of the program itself, are obtained by interacting with the ‘outside ’ world: when values are exchanged between applications by deserialization from disk, input is provided by a user, or part of a program is obtained over a network connection. Modern statically typed functional languages, such as Clean (van Eekelen et al., 1990), Haskell (Peyton Jones, 2003), and OCaml (Leroy et al., 2011), all support some form of dynamic typing, that allows programmers to defer type checking until runtime. These languages define a special type for dynamically typed values. We will abbreviate such dynamically typed values to dynamic value or just dynamic. A dynamically typed value
Auto in Agda Programming proof search using reflection
"... Abstract. As proofs in type theory become increasingly complex, there is a growing need to provide better proof automation. This paper shows how to implement a Prologstyle resolution procedure in the dependently typed programming language Agda. Connecting this resolution procedure to Agda’s reflec ..."
Abstract
 Add to MetaCart
(Show Context)
Abstract. As proofs in type theory become increasingly complex, there is a growing need to provide better proof automation. This paper shows how to implement a Prologstyle resolution procedure in the dependently typed programming language Agda. Connecting this resolution procedure to Agda’s reflection mechanism provides a firstclass proof search tactic for firstorder Agda terms. As a result, writing proof automation tactics need not be different from writing any other program. 1