Results 1  10
of
18
Generic programming: An introduction
 3rd International Summer School on Advanced Functional Programming
, 1999
"... ..."
Universal regular path queries
 HigherOrder and Symbolic Computation
, 2003
"... Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this proble ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this problem using relational algebra, and show how it may be implemented in Prolog. The motivation for the problem derives from a declarative framework for specifying compiler optimisations. 1 Bob Paige and IFIP WG 2.1 Bob Paige was a longstanding member of IFIP Working Group 2.1 on Algorithmic Languages and Calculi. In recent years, the main aim of this group has been to investigate the derivation of algorithms from specifications by program transformation. Already in the mideighties, Bob was way ahead of the pack: instead of applying transformational techniques to wellworn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular
Generic Programming With Relations and Functors
 Journal of Functional Programming
, 1999
"... This paper explores the idea of generic programming in which programs are parameterised by data types. Part of the constructive theory of lists, specically the part dealing with properties of segments, is generalised in two ways: from lists to arbitrary inductive data types, and from functions to ..."
Abstract

Cited by 9 (6 self)
 Add to MetaCart
This paper explores the idea of generic programming in which programs are parameterised by data types. Part of the constructive theory of lists, specically the part dealing with properties of segments, is generalised in two ways: from lists to arbitrary inductive data types, and from functions to relations. The new theory is used to solve a generic problem about segments. 1 Introduction To what extent is it possible to construct programs without knowing exactly what data types are involved? At rst sight this may seem a strange question, but consider the case of pattern matching. Over lists, this problem can be formulated in terms of two strings, a pattern and a text; the object is to determine if and where the pattern occurs as a segment of the text. Now, pattern matching can be generalised to other data types, including arrays and trees of various kinds; the essential step is to be able to dene the notion of `segment' in these types. So the intriguing question arises: can one...
A Relational Approach To Optimization Problems
, 1996
"... The main contribution of this thesis is a study of the dynamic programming and greedy strategies for solving combinatorial optimization problems. The study is carried out in the context of a calculus of relations, and generalises previous work by using a loop operator in the imperative programming s ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
The main contribution of this thesis is a study of the dynamic programming and greedy strategies for solving combinatorial optimization problems. The study is carried out in the context of a calculus of relations, and generalises previous work by using a loop operator in the imperative programming style for generating feasible solutions, rather than the fold and unfold operators of the functional programming style. The relationship between fold operators and loop operators is explored, and it is shown how to convert from the former to the latter. This fresh approach provides additional insights into the relationship between dynamic programming and greedy algorithms, and helps to unify previously distinct approaches to solving combinatorial optimization problems. Some of the solutions discovered are new and solve problems which had previously proved difficult. The material is illustrated with a selection of problems and solutions that is a mixture of old and new. Another contribution is the invention of a new calculus, called the graph calculus, which is a useful tool for reasoning in the relational calculus and other nonrelational calculi. The graph
Final Dialgebras: From Categories to Allegories
 Workshop on Fixed Points in Computer Science
, 1999
"... The study of inductive and coinductive types (like finite lists and streams, respectively) is usually conducted within the framework of category theory, which to all intents and purposes is a theory of sets and functions between sets. Allegory theory, an extension of category theory due to Freyd, is ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
The study of inductive and coinductive types (like finite lists and streams, respectively) is usually conducted within the framework of category theory, which to all intents and purposes is a theory of sets and functions between sets. Allegory theory, an extension of category theory due to Freyd, is better suited to modelling relations between sets as opposed to functions between sets. The question thus arises of how to extend the standard categorical results on the existence of final objects in categories (for example, coalgebras and products) to their existence in allegories. The motivation is to streamline current work on generic programming, in which the use of a relational theory rather than a functional theory has proved to be desirable. In this paper, we define the notion of a relational final dialgebra and prove, for an important class of dialgebras, that a relational final dialgebra exists in an allegory if and only if a final dialgebra exists in the underlying category of map...
Mathematical Induction Made Calculational
, 1994
"... Several concise formulations of mathematical induction are presented and proven equivalent. The formulations are expressed in variablefree relation algebra and thus are in terms of relations only, without mentioning the related objects. It is shown that the induction principle in this form lends ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Several concise formulations of mathematical induction are presented and proven equivalent. The formulations are expressed in variablefree relation algebra and thus are in terms of relations only, without mentioning the related objects. It is shown that the induction principle in this form lends itself very well for use in calculational proofs. As a nontrivial example a proof of a generalisation of Newman's lemma is given. The paper begins with an introduction to relation algebra and is reasonably selfcontained. (Some knowledge of lattice theory, in particular the KnasterTarski fixed point theorem for complete lattices, is assumed.) The style is expository and suggestions for exercises are included. The basic concept underlying many of the calculations is the notion of a Galois connection, and the paper could be seen as an introductory tutorial in the use of this concept. The idea of formal reasoning  by which we mean the manipulation of uninterpreted formulae accordi...
What is a Data Type?
, 1996
"... A program derivation is said to be polytypic if some of its parameters are data types. Polytypic program derivations necessitate a general, noninductive definition of `data type'. Here we propose such a definition: a data type is a relator that has membership. It is shown how this definition implie ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
A program derivation is said to be polytypic if some of its parameters are data types. Polytypic program derivations necessitate a general, noninductive definition of `data type'. Here we propose such a definition: a data type is a relator that has membership. It is shown how this definition implies various other properties that are shared by all data types. In particular, all data types have a unique strength, and all natural transformations between data types are strong. 1 Introduction What is a data type? It is easy to list a number of examples: pairs, lists, bags, finite sets, possibly infinite sets, function spaces . . . but such a list of examples hardly makes a definition. The obvious formalisation is a definition that builds up the class of data types inductively; such an inductive definition, however, leads to cumbersome proofs if we want to prove a property of all data types. Here we aim to give a noninductive characterisation, defining a data type as a mathematical object...
Inductive Datatypes with Laws and Subtyping – A Relational Model
 Faculty of Mathematics and Computing
"... ..."
An Exercise in Polytypic Program Derivation: repmin
, 1996
"... A program derivation is said to be polytypic if some of its parameters are data types. The repmin problem is to replace all elements of a tree of numbers by the minimum element, making only a single pass over the original tree. Here we present a polytypic derivation for that problem. The derivation ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
A program derivation is said to be polytypic if some of its parameters are data types. The repmin problem is to replace all elements of a tree of numbers by the minimum element, making only a single pass over the original tree. Here we present a polytypic derivation for that problem. The derivation has an unusual feature: when interpreted in the category of relations, the resulting program is the wellknown cyclic logic program, and when interpreted in the category of functions, it is the wellknown higherorder functional solution. 1 Motivation Suppose I were to show you a derivation of a shortest path algorithm, and my whole presentation was in terms of numbers, addition and minimum. Undoubtedly some of you would get up and point out that by abstracting over the operations and recording their algebraic properties, I could have derived a whole class of algorithms instead of one particular program. Indeed, such abstraction over operations is now commonly accepted as one of the hallmar...
Constructive Lattice Theory
, 1993
"... A notion of simulation of one datatype by another is defined as a constructive preorder. A calculus of datatype simulation is then developed by formulating constructive versions of leastfixedpoint theorems in lattice theory. The calculus is applied to the construction of several isomorphisms betwe ..."
Abstract

Cited by 3 (2 self)
 Add to MetaCart
A notion of simulation of one datatype by another is defined as a constructive preorder. A calculus of datatype simulation is then developed by formulating constructive versions of leastfixedpoint theorems in lattice theory. The calculus is applied to the construction of several isomorphisms between classes of datatypes. In particular constructive adaptations of theorems in lattice theory about closure operators are shown to yield simulations and isomorphisms between monad structures, and constructive adaptations of theorems in regular algebra are shown to yield isomorphisms between list structures. A question to which any respectable theory of datatypes should provide immediate answers is when two datatypes are isomorphic, i.e. entirely equivalent modulo implementation details. A subsidiary question is when one datatype simulates another. This second question is of interest in its own right but is also important to answering the first question since isomorphism is frequently reduce...