Conditional Control is not quite Categorical Control
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).
KeywordsConditional Operator Algebraic Theory Distributive Theory Horn Clause Primitive Type
Unable to display preview. Download preview PDF.
- J.R.B. Cockett, Introduction to distributive categories Maquarie Computing Report 90–0052C (1990).Google Scholar
- Y. Diers Categories of boolean sheaves of simple algebras,Lecture Notes in Mathematics 1187, Springer-Verlag, Berlin, Heidelberg, New York(1985).Google Scholar
- 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
- 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
- P.T. Johnstone Topos Theory Academic Press, London (1977).Google Scholar
- 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
- F.W. Lawvere Diagonal arguments and cartesian closed categories,Springer Lecture Notes in Mathematics 92, Springer-Verlag, Berlin (19) 134–145Google Scholar
- R.F.C. Walters Category Theory, Logic, and Computer Science,course notes of lectures given at Sydney University 1988/1989.Google Scholar