Results 1 - 10
of
11
Generic programming: An introduction
- 3rd International Summer School on Advanced Functional Programming
, 1999
"... ..."
When Do Datatypes Commute?
- Category Theory and Computer Science, 7th International Conference, volume 1290 of LNCS
, 1997
"... Polytypic programs are programs that are parameterised by type constructors (like List), unlike polymorphic programs which are parameterised by types (like Int). In this paper we formulate precisely the polytypic programming problem of "commuting " two datatypes. The precise formulation involves ..."
Abstract
-
Cited by 14 (3 self)
- Add to MetaCart
Polytypic programs are programs that are parameterised by type constructors (like List), unlike polymorphic programs which are parameterised by types (like Int). In this paper we formulate precisely the polytypic programming problem of "commuting " two datatypes. The precise formulation involves a novel notion of higher order polymorphism. We demonstrate via a number of examples the relevance and interest of the problem, and we show that all "regular datatypes" (the sort of datatypes that one can define in a functional programming language) do indeed commute according to our specification. The framework we use is the theory of allegories, a combination of category theory with the point-free relation calculus. 1 Polytypism The ability to abstract is vital to success in computer programming. At the macro level of requirements engineering the successful designer is the one able to abstract from the particular wishes of a few clients a general purpose product that can capture a l...
Universal regular path queries
- Higher-Order and Symbolic Computation
, 2003
"... Given are a directed edge-labelled 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 10 (1 self)
- Add to MetaCart
Given are a directed edge-labelled 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 long-standing 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 mid-eighties, Bob was way ahead of the pack: instead of applying transformational techniques to well-worn 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
Mathematics of Recursive Program Construction
, 2001
"... A discipline for the design of recursive programs is presented. The core concept ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
A discipline for the design of recursive programs is presented. The core concept
Categorical Fixed Point Calculus
, 1995
"... A number of lattice-theoretic fixed point rules are generalised to category theory and applied to the construction of isomorphisms between list structures. 1 Introduction Category theoreticians view a preordered set as a particular sort of category in which there is at most one arrow between any pa ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
A number of lattice-theoretic fixed point rules are generalised to category theory and applied to the construction of isomorphisms between list structures. 1 Introduction Category theoreticians view a preordered set as a particular sort of category in which there is at most one arrow between any pair of objects. According to this view, several concepts of lattice theory are instances of concepts of category theory as shown in table 1. An alternative viewpoint, advocated by Lambek [9], is that lattice theory is a valuable source of inspiration for novel results in category theory. Indeed, it is our view that for the purposes of advancing programming methodology category theory may profitably be regarded as "coherently constructive lattice theory 1 ". That is to say, arrows between objects of a category may be seen as "witnesses" to a preordering between the objects. Category theory is thus "constructive" because it is a theory about how to construct such witnesses rather than a theor...
Inductive Datatypes with Laws and Subtyping – A Relational Model
- Faculty of Mathematics and Computing
"... ..."
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 least-fixed-point 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 least-fixed-point 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...
A Calculational Approach to Mathematical Induction
, 1994
"... Several concise formulations of mathematical induction are presented and proven equivalent. The formulations are expressed in variable-free 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, when co ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Several concise formulations of mathematical induction are presented and proven equivalent. The formulations are expressed in variable-free 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, when combined with the explicit use of Galois connections, lends itself very well for use in calculational proofs. Two non-trivial examples are presented. The first is a proof of a Newman's lemma. The second is a calculation of a condition under which the union of two well-founded relations is wellfounded. In both cases the calculations lead to generalisations of the known results. In the case of the latter example, one lemma generalises three different conditions.
Relational Programming, Program Inversion and the Derivation of Parsing Algorithms
, 1993
"... The spec calculus is a programming algebra that supports and even encourages the derivation of relational programs in a clear and calculational style. After a brief introduction of the spec calculus two particular uses are investigated. First, the notion of program inversion is introduced. This noti ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
The spec calculus is a programming algebra that supports and even encourages the derivation of relational programs in a clear and calculational style. After a brief introduction of the spec calculus two particular uses are investigated. First, the notion of program inversion is introduced. This notion from imperative programming allows one to construct from a given program R that satisfies fPg R fQg a program R 1 that satis es fQg R 1 fPg . It is shown that, as may be expected, a relational framework allows easy definition of and calculation with inverses of arbitrary programs. Several examples are discussed and used to introduce different methods to calculate implementable inverses. The second topic is the derivation of precedence parsing algorithms. A simple algorithm for the calculation of the inorder traversal of a tree is transformed in two steps into an algorithm for precedence parsing. The first transformation is the use of program inversion to obtain an algorithm that constru...
Reductivity
, 1995
"... ing from these examples we propose the following definition: Definition 17 The relation R is said to be F-well-founded if and only if, for all relations S , the equation 19 X:: X = S ffl F:X ffl R has a unique solution. 2 By design, R is well-founded (in the conventional sense) if and only ..."
Abstract
- Add to MetaCart
ing from these examples we propose the following definition: Definition 17 The relation R is said to be F-well-founded if and only if, for all relations S , the equation 19 X:: X = S ffl F:X ffl R has a unique solution. 2 By design, R is well-founded (in the conventional sense) if and only if it is id-well-founded, where id is the identity relator. Moreover, the converse of any initial F -algebra is F-well-founded. A stronger statement can be made: Theorem 18 Suppose R is an F -coalgebra that is a bijection between F:R? and R? . Then the following are all equivalent: (a) R is F-well-founded, (b) R is F -reductive, (c) R[ is an initial F -algebra. 2 (The equivalence between (b) and (c) has already been observed.) One of the fundamental properties of reductivity is that it implies well-foundedness. This is theorem 7 of [3]. The converse is not true. Let R be a nonempty, well-founded relation (for example the relation succ[ on natural numbers) . Then it is easy to show th...

