in "Proc. 8th Int. Workshop on Software Specification and Design", J.Kramer and A.Wolf (eds), IEEE Computer Society Press 1996 ___________________________________________________ This work was partially supported by the Esprit BRA 8139 (MODELAGE), the HCM Scientific Network CHRX-CT92-0054 (MEDICIS) and JNICT under contract 2/2.1/MAT/46/94 (ESCOLA). A Mathematical Toolbox for the Software Architect José Luiz Fiadeiro Tom Maibaum Department of Informatics Department of Computing Faculty of Sciences, University of Lisbon Imperial College of Science, Technology and Medicine Campo Grande, 1700 Lisboa, PORTUGAL 180 Queen's Gate, London SW7 2BZ, UK llf@di.fc.ul.pt tsem@doc.ic.ac.uk Abstract It is suggested that Category Theory provides the right level of mathematical abstraction to address languages for describing software architectures. Contrarily to most other formalisations of SA concepts, Category Theory does not promote any particular formalism for component and connector description but provides instead the very semantics of the concepts that are related to the gross modularisation of complex systems like "interconnection", "configuration", "instantiation" and "composition". Two examples, a category of programs for a parallel program design lan guage and a category of temporal logic specifi - cations, together with comparisons with other work, namely by Allen and Garlan, and Moriconi and Qian, are adduced to justify this claim. 1. Introduction In a particularly stimulating panel introduction, Garlan and Perry present an overview of current research issues in Software Architecture (SA) [11]. They characterise SA to be "emerging as a significant and different design level that requires its own notations, theories, and tools". The purpose of this paper is to introduce some of the mathematical techniques that we think are useful for the toolbox of the software architect. Our aim is not to cover any specific language or approach but to illustrate how work developed in related fields of Computing is directly relevant to the concerns of SA. The specific tools that we have in mind are based on Category Theory, a fairly recent mathematical theory (as far as Mathematics is concerned), and have been developed since the early 70's by J.Goguen for formalising aspects of General Systems Theory (e.g. [15]), namely the process of building complex systems as interconnections of simpler components! Our main objective is to show that, as a mathematical notion, Category Theory (CT) captures much of the "spirit" and "practice" that one can recognise in the litera - ture on SA. First of all, one of the "myths" of Software Engineering, is that the use of diagrammatic notation is not formal, that it is at best semi-formal. Well, CT is all about chasing diagrams! In fact, one of the basic principles summarised in [13] is that complex systems can be use- fully identified with diagrams, system components and connectors corresponding to nodes, and interconnections being established through the edges of the diagrams. The subtlety here is that the word "diagram" in CT has a for- mal meaning and, at the same time, carries all the intu- itions that come from practice. This does not imply, how - ever, that all we have done with diagrams is CT! It just means that we can keep the same "language" and do "maths" that are not particularly distant from intuition. Secondly, and contrarily to most other formalisations of SA concepts that we have seen, CT is not another semantic domain in which to formalise the description of compo- nents and connectors (like, say, the use of CSP in [2] or first-order logic in [20]) but the very semantics of "inter - connection", "configuration", "instantiation" and "compo - sition", that which is related to the gross modularisation of complex systems. CT does this at a very abstract level be - cause what it proposes is a toolbox that can be applied to whatever formalism is chosen for capturing the behaviour of components (as long as that formalism satisfies some structural properties). Indeed, contrarily to Set Theory, CT focuses on relationships between objects (morphisms) rather that the representations of these objects. The focus on morphisms is paramount for SA because it determines the nature of the interconnections that can be established between the objects. Hence, the choice of a particular cat - egory can be seen to reflect the choice of a particular "ar - chitectural style". Thirdly, CT provides techniques for manipulating and reasoning about diagrams, namely for establishing hierar - chies of system complexity, allowing systems to be used as components of even more complex systems (i.e. to use diagrams as objects), and for inferring properties of sys- tems from their configurations. Indeed, as pointed out in [2], descriptive power is not sufficient: the underlying theory should also make it possible to analyse architectural descriptions, namely support reasoning about composi- tions of components and connectors. The message that we would like to convey is that there is a universality in the way that SA can be approached through CT. This universality facilitates the comparison