Results 1  10
of
83
Observational Equality, Now!
 A SUBMISSION TO PLPV 2007
, 2007
"... This paper has something new and positive to say about propositional equality in programming and proof systems based on the CurryHoward correspondence between propositions and types. We have found a way to present a propositional equality type • which is substitutive, allowing us to reason by repla ..."
Abstract

Cited by 43 (15 self)
 Add to MetaCart
This paper has something new and positive to say about propositional equality in programming and proof systems based on the CurryHoward correspondence between propositions and types. We have found a way to present a propositional equality type • which is substitutive, allowing us to reason by replacing equal for equal in propositions; • which reflects the observable behaviour of values rather than their construction: in particular, we have extensionality— functions are equal if they take equal inputs to equal outputs; • which retains strong normalisation, decidable typechecking and canonicity—the property that closed normal forms inhabiting datatypes have canonical constructors; • which allows inductive data structures to be expressed in terms of a standard characterisation of wellfounded trees; • which is presented syntactically—you can implement it directly, and we are doing so—this approach stands at the core of Epigram 2; • which you can play with now: we have simulated our system by a shallow embedding in Agda 2, shipping as part of the standard examples package for that system [20]. Until now, it has always been necessary to sacrifice some of these aspects. The closest attempt in the literature is Altenkirch’s construction of a setoidmodel for a system with canonicity and extensionality on top of an intensional type theory with proofirrelevant propositions [4]. Our new proposal simplifies Altenkirch’s construction by adopting McBride’s heterogeneous approach to equality [18].
Fast and Loose Reasoning is Morally Correct
, 2006
"... Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to nontotal (partial) languages. We justify such reasoning. ..."
Abstract

Cited by 38 (1 self)
 Add to MetaCart
Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to nontotal (partial) languages. We justify such reasoning.
Indexed Containers
"... Abstract. The search for an expressive calculus of datatypes in which canonical algorithms can be easily written and proven correct has proved to be an enduring challenge to the theoretical computer science community. Approaches such as polynomial types, strictly positive types and inductive types h ..."
Abstract

Cited by 36 (5 self)
 Add to MetaCart
(Show Context)
Abstract. The search for an expressive calculus of datatypes in which canonical algorithms can be easily written and proven correct has proved to be an enduring challenge to the theoretical computer science community. Approaches such as polynomial types, strictly positive types and inductive types have all met with some success but they tend not to cover important examples such as types with variable binding, types with constraints, nested types, dependent types etc. In order to compute with such types, we generalise from the traditional treatment of types as free standing entities to families of types which have some form of indexing. The hallmark of such indexed types is that one must usually compute not with an individual type in the family, but rather with the whole family simultaneously. We implement this simple idea by generalising our previous work on containers to what we call indexed containers and show that they cover a number of sophisticated datatypes and, indeed, other computationally interesting structures such as the refinement calculus and interaction structures. Finally, and rather surprisingly, the extra structure inherent in indexed containers simplifies the theory of containers and thereby allows for a much richer and more expressive calculus. 1
Symmetric Lenses
"... Lenses—bidirectional transformations between pairs of connected structures—have been extensively studied and are beginning to find their way into industrial practice. However, some aspects of their foundations remain poorly understood. In particular, most previous work has focused on the special cas ..."
Abstract

Cited by 34 (2 self)
 Add to MetaCart
(Show Context)
Lenses—bidirectional transformations between pairs of connected structures—have been extensively studied and are beginning to find their way into industrial practice. However, some aspects of their foundations remain poorly understood. In particular, most previous work has focused on the special case of asymmetric lenses, where one of the structures is taken as primary and the other is thought of as a projection, or view. A few studies have considered symmetric variants, where each structure contains information not present in the other, but these all lack the basic operation of composition. Moreover, while many domainspecific languages based on lenses have been designed, lenses have not been thoroughly studied from a more fundamental algebraic perspective. We offer two contributions to the theory of lenses. First, we present a new symmetric formulation, based on complements, an old idea from the database literature. This formulation generalizes the familiar structure of asymmetric lenses, and it admits a good notion of composition. Second, we explore the algebraic structure of the space of symmetric lenses. We present generalizations of a number of known constructions on asymmetric lenses and settle some longstanding questions about their properties—in particular, we prove the existence of (symmetric monoidal) tensor products and sums and the nonexistence of full categorical products or sums in the category of symmetric lenses. We then show how the methods of universal algebra can be applied to build iterator lenses for structured data such as lists and trees, yielding lenses for operations like mapping, filtering, and concatenation from first principles. Finally, we investigate an even more general technique for constructing mapping combinators, based on the theory of containers. 1.
A Universe of Binding and Computation
"... We construct a logical framework supporting datatypes that mix binding and computation, implemented as a universe in the dependently typed programming language Agda 2. We represent binding pronominally, using wellscoped de Bruijn indices, so that types can be used to reason about the scoping of var ..."
Abstract

Cited by 21 (5 self)
 Add to MetaCart
We construct a logical framework supporting datatypes that mix binding and computation, implemented as a universe in the dependently typed programming language Agda 2. We represent binding pronominally, using wellscoped de Bruijn indices, so that types can be used to reason about the scoping of variables. We equip our universe with datatypegeneric implementations of weakening, substitution, exchange, contraction, and subordinationbased strengthening, so that programmers need not reimplement these operations for each individual language they define. In our mixed, pronominal setting, weakening and substitution hold only under some conditions on types, but we show that these conditions can be discharged automatically in many cases. Finally, we program a variety of standard difficult test cases from the literature, such as normalizationbyevaluation for the untyped λcalculus, demonstrating that we can express detailed invariants about variable usage in a program’s type while still writing clean and clear code.
Constructing strictly positive families
 In The Australasian Theory Symposium (CATS2007
, 2007
"... We present an inductive definition of a universe containing codes for strictly positive families (SPFs) such as vectors or simply typed lambda terms. This construction extends the usual definition of inductive strictly positive types as given in previous joint work with McBride. We relate this to In ..."
Abstract

Cited by 20 (4 self)
 Add to MetaCart
(Show Context)
We present an inductive definition of a universe containing codes for strictly positive families (SPFs) such as vectors or simply typed lambda terms. This construction extends the usual definition of inductive strictly positive types as given in previous joint work with McBride. We relate this to Indexed Containers, which were recently proposed in joint work with Ghani, Hancock and McBride. We demonstrate by example how dependent types can be encoded in this universe and give examples for generic programs.
Edit Lenses
"... A lens is a bidirectional transformation between a pair of connected data structures, capable of translating an edit on one structure into an appropriate edit on the other. Many varieties of lenses have been studied, but none, to date, has offered a satisfactory treatment of how edits are represente ..."
Abstract

Cited by 19 (2 self)
 Add to MetaCart
(Show Context)
A lens is a bidirectional transformation between a pair of connected data structures, capable of translating an edit on one structure into an appropriate edit on the other. Many varieties of lenses have been studied, but none, to date, has offered a satisfactory treatment of how edits are represented. Many foundational accounts [5, 7] only consider edits of the form “overwrite the whole structure,” leading to poor behavior in many situations by failing to track the associations between corresponding parts of the structures when elements are inserted and deleted in ordered lists, for example. Other theories of lenses do maintain these associations, either by annotating the structures themselves with change information [6, 15] or using auxiliary data structures [2, 4], but every extant theory assumes that the entire original source structure is part of the information passed to the lens. We offer a general theory of edit lenses, which work with descriptions of changes to structures, rather than with the structures themselves. We identify a simple notion of “editable structure”—a set of states plus a monoid of edits with a partial monoid action on the states—and construct a semantic space of lenses between such structures, with natural laws governing their behavior. We show how a range of constructions from earlier papers on “statebased” lenses can be carried out in this space, including composition, products, sums, list operations, etc. Further, we show how to construct edit lenses for arbitrary containers in the sense of Abbott, Altenkirch, and Ghani [1]. Finally, we show that edit lenses refine a wellknown formulation of statebased lenses [7], in the sense that every statebased lens gives rise to an edit lens over structures with a simple overwriteonly edit language, and conversely every edit lens on such structures gives rise to a statebased lens. 1.
Foundational, Compositional (Co)datatypes for HigherOrder Logic  Category Theory Applied to Theorem Proving
"... Higherorder logic (HOL) forms the basis of several popular interactive theorem provers. These follow the definitional approach, reducing highlevel specifications to logical primitives. This also applies to the support for datatype definitions. However, the internal datatype construction used in H ..."
Abstract

Cited by 16 (10 self)
 Add to MetaCart
(Show Context)
Higherorder logic (HOL) forms the basis of several popular interactive theorem provers. These follow the definitional approach, reducing highlevel specifications to logical primitives. This also applies to the support for datatype definitions. However, the internal datatype construction used in HOL4, HOL Light, and Isabelle/HOL is fundamentally noncompositional, limiting its efficiency and flexibility, and it does not cater for codatatypes. We present a fully modular framework for constructing (co)datatypes in HOL, with support for mixed mutual and nested (co)recursion. Mixed (co)recursion enables type definitions involving both datatypes and codatatypes, such as the type of finitely branching trees of possibly infinite depth. Our framework draws heavily from category theory. The key notion is that of a rich type constructor—a functor satisfying specific properties preserved by interesting categorical operations. Our ideas are formalized in Isabelle and implemented as a new definitional package, answering a longstanding user request.
Continuous functions on final coalgebras
, 2007
"... In a previous paper we have given a representation of continuous functions on streams, both discretevalued functions, and functions between streams. the topology on streams is the ‘Baire ’ topology induced by taking as a basic neighbourhood the set of streams that share a given finite prefix. We ga ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
(Show Context)
In a previous paper we have given a representation of continuous functions on streams, both discretevalued functions, and functions between streams. the topology on streams is the ‘Baire ’ topology induced by taking as a basic neighbourhood the set of streams that share a given finite prefix. We gave also a combinator on the representations of stream processing functions that reflects composition. Streams are the simplest example of a nontrivial final coalgebras, playing in the coalgebraic realm the same role as do the natural numbers in the algebraic realm. Here we extend our previous results to cover the case of final coalgebras for a broad class of functors generalising (×A). The functors we deal with are those that arise from countable signatures of finiteplace untyped operators. These have many applications. The topology we put on the final coalgebra for such a functor is that induced by taking for basic neighbourhoods the set of infinite objects which share a common prefix, according to the usual definition of the final coalgebra as the limit of a certain inverse chain starting at �. 1
Generic programming with dependent types
 Spring School on Datatype Generic Programming
, 2006
"... In these lecture notes we give an overview of recent research on the relationship ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
In these lecture notes we give an overview of recent research on the relationship