Chapter

Electronic category theory

Authors:
To read the full-text of this research, you can request a copy directly from the author.

Abstract

This paper describes some experiments in using algebraic and categorical ideas to write programs. In particular a program to compute colimits in a category given coproducts and coequalisers has been written, also one to lift such colimits to comma categories. The discussion is informal and aims to show how categorical concepts can be painlessly realised in computational practice.

No full-text available

Request Full-text Paper PDF

To read the full-text of this research,
you can request a copy directly from the author.

Article
In this paper, we develop and study the following perspective -- just as higher-order functions give exponentials, higher-order continuations give coexponentials. From this, we design a language that combines exponentials and coexponentials, producing a duality of lambda abstraction. We formalise this language by giving an extension of a call-by-value simply-typed lambda-calculus with covalues, coabstraction, and coapplication. We develop the semantics of this language using the axiomatic structure of continuations, which we use to produce an equational theory, that gives a complete axiomatisation of control effects. We give a computational interpretation to this language using speculative execution and backtracking, and use this to derive the classical control operators and computational interpretation of classical logic, and encode common patterns of control flow using continuations. By dualising functional completeness, we further develop duals of first-order arrow languages using coexponentials. Finally, we discuss the implementation of this duality as control operators in programming, and develop some applications.
Article
Category theory has tong been widely recognised as being conveniently formalisable In constructive mathematics. We describe a computer implementation of its basic concepts, as an extension of the Goteborg implementation of Martin-Lofs theory of types; we discuss some alternative formulations of the theory (and our reasons for rejecting them) and briefly comment on the problems of automating the theorem-proving facilities of such an implementation. Our purposes in implementing such a system are various. First, the ability to prove theorems of category theory would be useful, in connection with the current [33] growth of interest in category theory for formalising notions from computer science, such as implementation of languages, data abstraction, and algorithm development. Second, it is one of the more interesting theories in mathematics, with many different levels of meaning and application, allowing a wide variety of different ways of looking at a single problem, and with important abstract concepts like adjointness. Third, there are links [07], 1411 between category theory and strong typing systems (such as that of ML, or of Martin-Lot), which the implementation of categorikal concepts should help us to explore. Fourth, Martin-LOf type theory is now being investigated by many as an abstract functional programming language, and the implementation of category theory therein presented an opportunity further to develop the type theory system itself. Rydeheard and Burstall [06] have implemented a more substantial part of category theory. Our approach differs from theirs by also covering equations. Put otherwise, 'category' in our system is a much stronger notion than theirs, just as there Is a difference between types of Martin-LOfs system and those of ML.
Article
This is a survey of methods of formalizing semantics of programming languages (algorithmic languages and specification languages). Principal attention is devoted to the logical approach.
Article
This research demonstrates that formal, mathematical analysis in theoretical computer science can be recast in terms of the topology of complete metric spaces, and also presents a methodical technique for developing formal specifications. This effort shows that the topology of complete metric spaces provides a tool that can be used to both recreate major results about computational models and also to develop new results about these models. Using the two computational models CSP and UNITY, this effort shows that the required mathematics needed to support this alternative to the traditional analysis of computational models can be readily supported by a standard course sequence in real analysis. Since the approach of proving programs correct after being written has not been widely accepted, this effort presents an alternative approach based on the developed topological framework for the formal specification language UNITY. this approach, designed to be automated, uses a set of transformations applied to UNITY specifications that preserve desired program properties.
Conference Paper
This paper shows how the constructions involved in category theory may be turned into computer programs. Key issues are the computational representation of categories and of universal properties. The approach is illustrated with a program for computing finite limits of an arbitrary category; this is written in the functional programming language ML. We have developed such programs for a number of categorical constructions.
Conference Paper
This paper is an exposition of the basic ideas of the mathematical theory of sketches and a detailed description of some of the ways in which this theory can be used in theoretical computer science to specify datatypes. In particular, this theory provides a convenient way of introducing datatypes which have variants, for example in case of errors or nil pointers. The semantics is a generalization of initial algebra semantics which in some cases allows initial algebras depending on a parameter such as a bound for overflow.
Conference Paper
Recently there has been a significant confluence of ideas from category theory, constructive type theory and functional programming. Our goal is to develop a toolkit that provides mechanical assistance in putting together constructive proofs of theorems in category theory and to extract executable programs from the result. We describe a machine-assisted proof of the adjoint functor theorem from category theory. The theorem is a simple version of the adjoint functor theorem. It was chosen because of its interesting constructive content, the fact that the machine-checked proof is fairly large and because it is mathematically non-trivial. The category theory toolkit was built on top of the Nuprl system. The core of this toolkit is a collection of tactics for mechanizing “diagram chasing”. We selected Nuprl because the underlying type theory is constructive and one can automatically extract executable programs from the proofs and partly because of the large collection of tactics and techniques that were available to us. So far we have concentrated on proving the theorem rather than on extracting the computational content of the theorem.
Article
Formal Aspects of Computing are dedicated to Professor Rod Burstall, and, as a collection of papers, memoirs and incidental pieces, form a Festschrift for Rod. The contributions are made by some of the many who know Rod and have been in uenced by him. The research papers included here represent some of the areas in which Rod has been active, and the editors thank their colleagues for agreeing to contribute to this Festschrift.
Article
Full-text available
An applicative language called HOPE is described and discussed. The underlying goal of the design and implementation effort was to produce a very simple programming language which encourages the construction of clear and manipulable programs. HOPE does not include an assignment statement; this is felt to be an important simplification. The user may freely define his own data types, without the need to devise a complicated encoding in terms of low-level types. The language is very strongly typed, and as implemented it incorporates a typechecker which handles polymorphic types and overloaded operators. Functions are defined by a set of recursion equations; the left-hand side of each equation includes a pattern used to determine which equation to use for a given argument. The availability of arbitrary higher-order types allows functions to be defined which 'package' recursion. Lazily-evaluated lists are provided, allowing the use of infinite lists which could be used to provide interactive input/output and concurrency.
Conference Paper
Full-text available
This paper introduces a new mathematical approach to transformations of structures, where the concept of "structure" is extremely general. Many structures and transformations that arise in biology as well as computer science are special cases of our concepts. A structure may be changed by finding an occurrence of a pattern and replacing it by another pattern as specified by a rule. To prove theorems about long sequences of applications of complicated rules, we need precise and tractable mathematical definitions of rules and how to apply them. This paper presents such definitions and some fundamental theorems, together with brief remarks on applications to record handling, evaluation of recursively defined functions, and control flow analysis for optimizing compilers.
Article
Full-text available
An applicative language called HOPE is described and discussed. The underlying goal of the design and implementation effort was to produce a very simple programming language which encourages the construction of clear and manipulable programs. HOPE does not include an assignment statement; this is felt to be an important simplification. The user may freely define his own data types, without the need to devise a complicated encoding in terms of low-level types. The language is very strongly typed, and as implemented it incorporates a typechecker which handles polymorphic types and overloaded operators. Functions are defined by a set of recursion equations; the left-hand side of each equation includes a pattern used to determine which equation to use for a given argument. The availability of arbitrary higher-order types allows functions to be defined which 'package' recursion. Lazily-evaluated lists are provided, allowing the use of infinite lists which could be used to provide interactive input/output and concurrency.
Chapter
This chapter discusses some techniques for recognizing structures in pictures. The research aims to develop techniques whereby a machine may observe its surroundings and then use its observations to achieve goals in an effective and efficient manner. To fulfill such requirements, the machine will inevitably use knowledge gained from past experience and observation to plan its activities, and also to interpret its sensory data. The chapter discusses the idea of a finite relational structure, that is, a set of elements with given properties and relations among them, as a useful mathematical tool for describing pictures, and to describe general techniques for matching such structures against each other. The matching process for relational structures attempts to find whether one structure occurs in or is a substructure of another structure. More precisely one need a function that assigns to each element of the first structure a distinct element of the second structure in such a way as to preserve the properties and relations which subsist in the first structure.
Article
Results are presented of some applications of universal algebra and automata theory to programming problems. A method of defining some functions as homomorphisms instead of giving recursive or iterative definitions is explained. As a demonstration of the use of this approach, a proof of the correctness of a simple compiler for expressions is given. The method of description is closely related to the methods of proving theorems about the objects described. The report includes a section on basic algebraic concepts as background for the applications, and a section in which functions commonly encountered in programming are expressed as homomorphisms. (Author)
Article
The purpose of this paper is to sketch a simplified version of Goguen’s general systems theory [4], [2], [3] using graphs and sets instead of categories insofar as possible, accompanied by intuitive motivation and simple examples. We also introduce basic theorems relating some fundamental concepts of system theory but space limitations preclude much background information and all proofs. These details will appear elsewhere.
Book
I. Categories, Functors and Natural Transformations.- 1. Axioms for Categories.- 2. Categories.- 3. Functors.- 4. Natural Transformations.- 5. Monics, Epis, and Zeros.- 6. Foundations.- 7. Large Categories.- 8. Hom-sets.- II. Constructions on Categories.- 1. Duality.- 2. Contravariance and Opposites.- 3. Products of Categories.- 4. Functor Categories.- 5. The Category of All Categories.- 6. Comma Categories.- 7. Graphs and Free Categories.- 8. Quotient Categories.- III. Universals and Limits.- 1. Universal Arrows.- 2. The Yoneda Lemma.- 3. Coproducts and Colimits.- 4. Products and Limits.- 5. Categories with Finite Products.- 6. Groups in Categories.- IV. Adjoints.- 1. Adjunctions.- 2. Examples of Adjoints.- 3. Reflective Subcategories.- 4. Equivalence of Categories.- 5. Adjoints for Preorders.- 6. Cartesian Closed Categories.- 7. Transformations of Adjoints.- 8. Composition of Adjoints.- V. Limits.- 1. Creation of Limits.- 2. Limits by Products and Equalizers.- 3. Limits with Parameters.- 4. Preservation of Limits.- 5. Adjoints on Limits.- 6. Freyd's Adjoint Functor Theorem.- 7. Subobjects and Generators.- 8. The Special Adjoint Functor Theorem.- 9. Adjoints in Topology.- VI. Monads and Algebras.- 1. Monads in a Category.- 2. Algebras for a Monad.- 3. The Comparison with Algebras.- 4. Words and Free Semigroups.- 5. Free Algebras for a Monad.- 6. Split Coequalizers.- 7. Beck's Theorem.- 8. Algebras are T-algebras.- 9. Compact Hausdorff Spaces.- VII. Monoids.- 1. Monoidal Categories.- 2. Coherence.- 3. Monoids.- 4. Actions.- 5. The Simplicial Category.- 6. Monads and Homology.- 7. Closed Categories.- 8. Compactly Generated Spaces.- 9. Loops and Suspensions.- VIII. Abelian Categories.- 1. Kernels and Cokernels.- 2. Additive Categories.- 3. Abelian Categories.- 4. Diagram Lemmas.- IX. Special Limits.- 1. Filtered Limits.- 2. Interchange of Limits.- 3. Final Functors.- 4. Diagonal Naturality.- 5. Ends.- 6. Coends.- 7. Ends with Parameters.- 8. Iterated Ends and Limits.- X. Kan Extensions.- 1. Adjoints and Limits.- 2. Weak Universality.- 3. The Kan Extension.- 4. Kan Extensions as Coends.- 5. Pointwise Kan Extensions.- 6. Density.- 7. All Concepts are Kan Extensions.- Table of Terminology.
Article
Specifications of software modules are frequently represented by triples <S,Z,E> where S is meant to be a certain set of sorts, X a set of operations over S and E a set of exp!anation s of the semantics of the operations and their relations to each other. Algebraic specification techniques take E to be a set of Z-equations, sometimes also called algebraic axioms. The pair <S,[> is called a signature. As implementations of the abstract software module specified by <S,Z,E> one accepts all S-sorted E-algebras which satisfy the equations E. There is even a canonical representative for the abstract module, the initial <Z,E>-algebra TX,E. [6].
Article
The paper presents an algebraic theory of graph-grammars using homomorphisms and pushout-constructions to specify embeddings and direct derivations constructively. We consider the case of arbitrary directed graphs permitting loops and parallel edges. The gluing of two arbitrary labeled graphs (push-out) is defined allowing a strictly symmetric definition of direct derivations and the embedding of derivations into a common frame. A two-dimensional hierarchy of graph-grammars is given including the classical case of Chomsky-grammars and several other graphgrammar constructions as special types. The use of well-known categorical constructions and results allows simplification of the proofs and pregnant formulation of concepts like "parallel composition" and "translation of grammars".
Conference Paper
Following Lockwood Morris, a method for algebraically structuring a compiler and proving it correct is described. An example language with block structure and side-effects is presented. This determines an initial many-sorted algebra L which is the ‘abstract syntax’ of the example language. Then the semantics of L is completely determined by describing a semantic algebra M ‘similar’ to L. In particular, initiality of L ensures that there is a unique homomorphism Lsem:L→>M. This is algebraically structuring the semantic definition of the language.A category of flow-charts over a stack machine is used as a target language for the purposes of compilation. The semantics of the flow charts (Tsem:T→S) is also algebraically determined given interpretations of the primitive operations on the stack and store. The homomorphism comp:L→ T is the compiler which is also uniquely determined by presenting an algebra T of flowcharts similar to L. This is algebraically structuring the compiler.Finally a function encode:M→S describes source meanings in terms of target meanings. The proof that the compiler is correct reduces to a proof that encode:M→S is a homomorphism; then both comp ∘ Tsem and Lsem ∘ encode are homomorphisms from L to S and they must be equal because there is only one homomorphism from L to S.
Chapter
This paper gives a semantics for the Clear language for specifying problems and programs, described by Burstall and Goguen in 1977. A blend of denotational semantics with categorical ideas is used.
Article
This paper develops a number of fundamental tools from category theory and applies them to problems in computation. The tools include algebraic theories, colimits, comma categories and two-dimensional categories. The applications concern making program specifications understandable by expressing them as interconnections of smaller ‘mind sized’ specifications in a variety of ways, as in our language spCLEAR. The link between these tools and applications is the idea of using algebraic theories as program specifications. To carry out this programme requires developing a formal calculus of operations for constructing, modifying and interconnecting theories. These operations include: constructing free theories, combining given theories, deriving new computational functions from old, abstracting (or ‘hiding’) parts of theories, inductively completing a theory, and applying a theory-valued procedure to an actual theory. Because a number of different notions of theory are relevant to computation, this paper also sketches an axiomatically based calculus of operations applicable to any notion of theory which satisfies certain axioms. The paper also presents a number of sample calculations illustrating how the various tools can be used, and proves some general theorems which justify such calculations. Part 1 develops comma categories, colimits, signatures and sorted theories, while Part 2 (to appear in Theoretical Computer Science 31 (3)) introduces signed theories, abstract theories, and further applications to specification.
Chapter
Conventional programming languages are growing ever more enormous, but not stronger. Inherent defects at the most basic level cause them to be both fat and weak: their primitive word-at-a-time style of programming inherited from their common ancestor—the von Neumann computer, their close coupling of semantics to state transitions, their division of programming into a world of expressions and a world of statements, their inability to effectively use powerful combining forms for building new programs from existing ones, and their lack of useful mathematical properties for reasoning about programs. An alternative functional style of programming is founded on the use of combining forms for creating programs. Functional programs deal with structured data, are often nonrepetitive and nonrecursive, are hierarchically constructed, do not name their arguments, and do not require the complex machinery of procedure declarations to become generally applicable. Combining forms can use high level programs to build still higher level ones in a style not possible in conventional languages. Associated with the functional style of programming is an algebra of programs whose variables range over programs and whose operations are combining forms. This algebra can be used to transform programs and to solve equations whose “unknowns” are programs in much the same way one transforms equations in high school algebra. These transformations are given by algebraic laws and are carried out in the same language in which programs are written. Combining forms are chosen not only for their programming power but also for the power of their associated algebraic laws. General theorems of the algebra give the detailed behavior and termination conditions for large classes of programs. A new class of computing systems uses the functional programming style both in its programming language and in its state transition rules. Unlike von Neumann languages, these systems have semantics loosely coupled to states—only one state transition occurs per major computation.
Arrows, Structures and Functors
  • M Arbib
  • E Manes
Discovering the structure of an automaton from partial information
  • G Perryman
Some fundamental properties of algebraic theories: a tool for semantics of computation
  • J A Goguen
  • R M Burstall