Program Calculation Properties of Continuous Algebras

Defining data types as initial algebras, or dually as final co-algebras, is beneficial, if not indispensible, for an algebraic calculus for program construction, in view of the nice equational properties that then become available. It is not hard to render finite lists as an initial algebra and, dually, infinite lists as a final co-algebra. However, this would mean that there are two distinct data types for lists, and then a program that is applicable to both finite and infinite lists is not possible, and arbitrary recursive definitions are not allowed. We prove the existence of algebras that are both initial in one category of algebras and final in the closely related category of co-algebras, and for which arbitrary (continuous) fixed point definitions ("recursion") do have a solution. Thus there is a single data type that comprises both the finite and the infinite lists. The price to be paid, however, is that partiality (of functions and values) is unavoidable. We derive, for any such data type, various laws that are useful for an algebraic calculus of programs.

[1]  Tatsuya Hagino,et al.  A Typed Lambda Calculus with Categorical Type Constructors , 1987, Category Theory and Computer Science.

[2]  John C. Reynolds Semantics of the Domain of Flow Diagrams , 1977, JACM.

[3]  Joyce L. Vedral,et al.  Functional Programming Languages and Computer Architecture , 1989, Lecture Notes in Computer Science.

[4]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[5]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[6]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[7]  C. Hemerik,et al.  An introduction to the category-theoretic solution of recursive domain equations , 1988 .

[8]  Manfred Broy,et al.  Logic of Programming and Calculi of Discrete Design , 1987, NATO ASI Series.

[9]  Philip Wadler,et al.  Comprehending monads , 1990, Mathematical Structures in Computer Science.

[10]  Peter J. Landin,et al.  PROGRAMS AND THEIR PROOFS: AN ALGEBRAIC APPROACH, , 1968 .

[11]  Richard S. Bird The promotion and accumulation strategies in transformational programming , 1984, TOPL.

[12]  Carl A. Gunter,et al.  Semantic Domains and Denotational Semantics , 1989 .

[13]  Richard S. Bird,et al.  Programs and Machines , 1976 .

[14]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .

[15]  H. Kilov Structured system programming , 1985, Proceedings of the IEEE.

[16]  Giuseppe Attardi,et al.  Towards a More Declarative Programming Style , 1977, Formal Description of Programming Concepts.

[17]  G. Malcolm,et al.  Data Structures and Program Transformation , 1990, Sci. Comput. Program..

[18]  Richard S. Bird,et al.  Formal Derivation of a Pattern Matching Algorithm , 1989, Sci. Comput. Program..

[19]  Grant Malcolm Homomorphisms and Promotability , 1989, MPC.

[20]  Richard S. Bird,et al.  A calculus of functions for program derivation , 1990 .

[21]  N. Verwer Homomorphisms, factorisation and promotion , 1990 .

[22]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[23]  Lambert Meertens,et al.  Algorithmics : towards programming as a mathematical activity , 1986 .

[24]  Grant Malcolm,et al.  Algebraic Data Types and Program Transformation , 1990 .

[25]  Helmuth Partsch,et al.  Transformational Program Development in a Particular Program Domain , 1986, Sci. Comput. Program..

[26]  Roland Carl Backhouse An Exploration of the Bird-Meertens Formalism , 1989 .

[27]  Mitchell Wand Fixed-Point Constructions in Order-Enriched Categories , 1979, Theor. Comput. Sci..

[28]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[29]  Michael A. Arbib,et al.  Algebraic Approaches to Program Semantics , 1986, Texts and Monographs in Computer Science.

[30]  John W. Backus,et al.  Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs , 1978, CACM.

[31]  Richard S. Bird,et al.  An introduction to the theory of lists , 1987 .

[32]  Jim Welsh,et al.  Structured System Programming , 1980 .