Results 1  10
of
18
A Fold for All Seasons
 IN PROC. CONFERENCE ON FUNCTIONAL PROGRAMMING LANGUAGES AND COMPUTER ARCHITECTURE
, 1993
"... Generic control operators, such as fold, can be generated from algebraic type definitions. The class of types to which these techniques are applicable is generalized to all algebraic types definable in languages such as Miranda and ML, i.e. mutually recursive sumsofproducts with tuples and functio ..."
Abstract

Cited by 113 (15 self)
 Add to MetaCart
Generic control operators, such as fold, can be generated from algebraic type definitions. The class of types to which these techniques are applicable is generalized to all algebraic types definable in languages such as Miranda and ML, i.e. mutually recursive sumsofproducts with tuples and function types. Several other useful generic operators, also applicable to every type in this class, also are described. A normalization algorithm which automatically calculates improvements to programs expressed in a language based upon folds is described. It reduces programs, expressed using fold as the exclusive control operator, to a canonical form. Based upon a generic promotion theorem, the algorithm is facilitated by the explicit structure of fold programs rather than using an analysis phase to search for implicit structure. Canonical programs are minimal in the sense that they contain the fewest number of fold operations. Because of this property, the normalization algorithm has important ...
A Semantics for Shape
 Science of Computer Programming
, 1995
"... Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checking. ..."
Abstract

Cited by 60 (18 self)
 Add to MetaCart
Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checking. The shapely types are closed under the formation of fixpoints, and hence include the usual algebraic types of lists, trees, etc. They also include other standard data structures such as arrays, graphs and records. 1 Introduction The values of a shapely type are uniquely determined by their shape and their data. The shape can be thought of as a structure with holes or positions, into which data elements (stored in a list) can be inserted. The use of shape in computing is widespread, but till now it has not, apparently, been the subject of independent study. The body of the paper presents a semantics for shape, based on elementary ideas from category theory. First, let us consider some examp...
Proof Principles for Datatypes with Iterated Recursion
, 1997
"... . Data types like trees which are finitely branching and of (possibly) infinite depth are described by iterating initial algebras and terminal coalgebras. We study proof principles for such data types in the context of categorical logic, following and extending the approach of [14, 15]. The technica ..."
Abstract

Cited by 17 (3 self)
 Add to MetaCart
. Data types like trees which are finitely branching and of (possibly) infinite depth are described by iterating initial algebras and terminal coalgebras. We study proof principles for such data types in the context of categorical logic, following and extending the approach of [14, 15]. The technical contribution of this paper involves a description of initial algebras and terminal coalgebras in total categories of fibrations for lifted "datafunctors". These lifted functors are used to formulate our proof principles. We test these principles by proving some elementary results for four kinds of trees (with finite or infinite breadth or depth) using the proof tool pvs. 1 Introduction Algebras and coalgebras are of wellestablished importance in computer science, notably in the theory of datatypes, where especially initial algebras and terminal coalgebras play a distinguished role. Over the past decade there is more and more interest in the logic associated with initial algebras and ter...
Polynomial Polymorphism
 Proceedings of the Eighteenth Australasian Computer Science Conference: Glenelg, South Australia 13 February
, 1995
"... Inductive types, such as lists and trees, have a uniform semantic description, both of the types themselves and the folding algorithms that construct homomorphisms out of them. Though implementations have been able to give a uniform description of the types, this has not been true of folding, since ..."
Abstract

Cited by 12 (4 self)
 Add to MetaCart
Inductive types, such as lists and trees, have a uniform semantic description, both of the types themselves and the folding algorithms that construct homomorphisms out of them. Though implementations have been able to give a uniform description of the types, this has not been true of folding, since there has not been a uniform mechanism for finding the subexpressions (the sublists or subtrees, etc.) to which recursion applies. Polynomial types overcome this problem by distinguishing the indeterminate of the polynomial (on which the recursion occurs) from its coefficients. Further, this uniformity is recognised by the type system, which is able to treat fld as a (shape) polymorphic constant of the calculus. These ideas have been implemented in a language P2. Key words types, polynomials, polymorphism, folding, shape, P2. 1 Introduction The use of initial algebras to describe inductive data types, such as lists and trees, produces a uniform method for describing a large class of ...
Container Types Categorically
, 2000
"... A program derivation is said to be polytypic if some of its parameters are data types. Often these data types are container types, whose elements store data. Polytypic program derivations necessitate a general, noninductive definition of `container (data) type'. Here we propose such a definition: a ..."
Abstract

Cited by 12 (0 self)
 Add to MetaCart
A program derivation is said to be polytypic if some of its parameters are data types. Often these data types are container types, whose elements store data. Polytypic program derivations necessitate a general, noninductive definition of `container (data) type'. Here we propose such a definition: a container type is a relator that has membership. It is shown how this definition implies various other properties that are shared by all container types. In particular, all container types have a unique strength, and all natural transformations between container types are strong. Capsule Review Progress in a scientific dicipline is readily equated with an increase in the volume of knowledge, but the true milestones are formed by the introduction of solid, precise and usable definitions. Here you will find the first generic (`polytypic') definition of the notion of `container type', a definition that is remarkably simple and suitable for formal generic proofs (as is amply illustrated in t...
Inductive Data Types for Predicate Transformers
 Information Processing Letters
, 1995
"... Introduction Modern functional programming languages [5, 6] and specification formalisms [3] are built around the notion of inductive data types and homomorphisms on these data types. Such homomorphisms, which correspond to the familiar fold or reduce operators in functional programming, are calle ..."
Abstract

Cited by 9 (1 self)
 Add to MetaCart
Introduction Modern functional programming languages [5, 6] and specification formalisms [3] are built around the notion of inductive data types and homomorphisms on these data types. Such homomorphisms, which correspond to the familiar fold or reduce operators in functional programming, are called catamorphisms. In this note, it is shown how catamorphisms can be generalised from functions to relations, and from relations to predicate transformers. The first step of this generalisation (from functions to relations) was already achieved in a slightly different setting by Backhouse et al. [2]; the generalisation to predicate transformers is new. In practical terms, the main result presented here says that a calculus based on predicate transformers (like the refinement calculus studied by Back, Morgan and others [1, 14]) can be enriched with program constructors for iterating over inductive data types. The refineme
Coalgebraic Theories of Sequences in PVS
, 1998
"... This paper explains the setting of an extensive formalisation of the theory of sequences (finite and infinite lists of elements of some data type) in the Prototype Verification System pvs. This formalisation is based on the characterisation of sequences as a final coalgebra, which is used as an axi ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
This paper explains the setting of an extensive formalisation of the theory of sequences (finite and infinite lists of elements of some data type) in the Prototype Verification System pvs. This formalisation is based on the characterisation of sequences as a final coalgebra, which is used as an axiom. The resulting theories comprise standard operations on sequences like composition (or concatenation), filtering, flattening, and their properties. They also involve the prefix ordering and proofs that sequences form an algebraic complete partial order. The finality axiom gives rise to various reasoning principles, like bisimulation, simulation, invariance, and induction for admissible predicates. Most of the proofs of equality statements are based on bisimulations, and most of the proofs of prefix order statements use simulations. Some significant aspects of these theories are described in detail. This coalgebraic formalisation of sequences is presented as a concrete example that shows t...
A View on Implementing Processes: Categories of Circuits
, 1996
"... . We construct a category of circuits: the objects are alphabets and the morphisms are deterministic automata. The construction differs in several respects from the bicategories of circuits appearing previously in the literature: it is parameterized by a monad which allows flexibility in the emergen ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
. We construct a category of circuits: the objects are alphabets and the morphisms are deterministic automata. The construction differs in several respects from the bicategories of circuits appearing previously in the literature: it is parameterized by a monad which allows flexibility in the emergent notion of process. We focus on the circuits which arise from a distributive category and the exception monad. These circuits are partial in that they may, based on their state, choose to abort on some inputs. Consequently, certain circuits determine languages, and safety and liveness properties with respect to these languages are captured by circuit equations. Actually, the notions of safety and liveness arise abstractly in any copy category. Extracting the category of circuits which are both safe and live corresponds to the extensive completion of a distributive copy category. Partial circuits coincide with elements of the terminal coalgebra of a specific datatype. The coinduction princ...
Between Dynamic Programming and Greedy: Data Compression
 Programming Research Group, 11 Keble Road, Oxford OX1 3QD
, 1995
"... The derivation of certain algorithms can be seen as a hybrid form of dynamic programming and the greedy paradigm. We present a generic theorem about such algorithms, and show how it can be applied to the derivation of an algorithm for data compression. 1 Introduction Dynamic programming is a techni ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
The derivation of certain algorithms can be seen as a hybrid form of dynamic programming and the greedy paradigm. We present a generic theorem about such algorithms, and show how it can be applied to the derivation of an algorithm for data compression. 1 Introduction Dynamic programming is a technique for solving optimisation problems. A typical dynamic programming algorithm proceeds by decomposing the input in all possible ways, recursively solving the subproblems, and combining optimal solutions to subproblems into an optimal solution for the whole problem. The greedy paradigm is also a technique for solving optimisation problems and differs from dynamic programming in that only one decomposition of the input is considered. Such a decomposition is usually chosen to maximise some objective function, and this explains the term `greedy'. In our earlier work, we have characterised the use of dynamic programming and the greedy paradigm, using the categorical calculus of relations to der...