IV Higher Order Workshop, Banff 1990 pp 190-217 | Cite as

# Conditional Control is not quite Categorical Control

## Abstract

It is often the intent of an algebraic specification of a data structure to include an aspect of control. For example, a stack is either empty or nonempty and one expects to be able to perform different actions based on this test. The question of whether an algebraic specification correctly expresses the intended control is related to a categorical question concerning whether the equalizer completion of the theory is distributive.

A many-sorted algebraic theory T is distributive whenever its (product preserving) equalizer completion, or equivalently the dual of the category of finitely presented algebras, *ε*(T) = (Set _{f} ^{T} )^{op} is a distributive category. This happens precisely when it has inhabited types and a weak form of “if...then...else” operator satisfying certain Horn clauses.

Of philosophical interest is the observation that if one drops the requirement that the types are inhabited the above correspondence fails. This means that the traditional method of adding control using conditional operators does not in general correspond to the categorical notion of control as given in distributive categories (or even locally predistributive categories).

### Keywords

Topo Cond Cogeneration Agram## Preview

Unable to display preview. Download preview PDF.

### References

- [1]J.R.B. Cockett,
*Introduction to distributive categories*Maquarie Computing Report 90–0052C (1990).Google Scholar - [2]S. Bloom and R. Tindell,
*Varieties of if…then…else*SIAM Journal on Computing 12 (4) (1983) 677–707.CrossRefMathSciNetMATHGoogle Scholar - [3]B.A. Davey and H. Werner,
*Distributivity of coproducts over products*. Algebra Universalis, 12 (1981) 387–394.CrossRefMathSciNetMATHGoogle Scholar - [4]Y. Diers
*Categories of boolean sheaves of simple algebras*,Lecture Notes in Mathematics 1187, Springer-Verlag, Berlin, Heidelberg, New York(1985).Google Scholar - [5]H. Ehrig and B. Mahr
*Fundamentals of algebraic specification I: equations and initial semantics*. Springer Verlag, Berlin (1985).MATHGoogle Scholar - [6]H. Huwig and A. Poigne,
*A note on the inconsistencies caused by fixed points in a cartesian closed category*, Theoretical Computer Science 73 (1989).Google Scholar - [7]J.A. Goguen “Higher-order functions considered unnecessary for higher-order programming.” In
*Research topics in functional programming*Ed. D.A. Turner, Addison-Wesley (1990).Google Scholar - [8]P.T. Johnstone
*Topos Theory*Academic Press, London (1977).Google Scholar - [9]C. Kirchner, H. Kirchner and J. Meseguer “Operational Semantics of OBJ3.” In
*Proceedings of the 9th International Conference on Automata*,*Languages*,*and Programming*. Lecture Notes in Computer Science, vol. 241. Springer-Verlag, Berlin (1988).Google Scholar - [10]F.W. Lawvere
*Diagonal arguments and cartesian closed categories*,Springer Lecture Notes in Mathematics 92, Springer-Verlag, Berlin (19) 134–145Google Scholar - [11]R.F.C. Walters
*Datatypes in distributive categories*, Bull. Australian Mathematics Society 40 (1989) 79–82.CrossRefMathSciNetMATHGoogle Scholar - [12]R.F.C. Walters
*Category Theory*,*Logic*,*and Computer Science*,course notes of lectures given at Sydney University 1988/1989.Google Scholar - [13]C. Wells
*A generalization of the concept of a sketch*, Journal of theoretical Computer Science 70 (1990) 159–178.CrossRefMATHGoogle Scholar