DAWN for component based systems – just a different perspective – Ekkart Kindler Universität Paderborn, Institut für Informatik, D-33095 Paderborn, Germany kindler@upb.de Abstract DAWN is technique for modelling and verifying network algorithms, which is based on Petri nets and temporal logic. In this paper, we present a dif- ferent perspective of DAWN that allows us to use it for verifying component bases systems by modelling components and their interaction independently of each other. 1 Introduction In a nutshell, a component based system consist of components which interact with each other. Each component encapsulates some kind of service. A component based system is built by combining and interconnecting the components. Therefore, the component ba- sed approach supports reusability and flexibility – the implementations of the individual components are independent from the overall structure (architecture) of the system. For modelling a component based system, we need to model the behaviour of the individu- al components as well as their interaction. For modelling the components, there is a huge variety of formalisms: starting from programming languages such as Java, via model- ling formalism such as State Charts [Har87], to more theoretical models such as process algebras [Mil89] or Petri nets. The interaction among the components is defined by ar- chitecture description languages (ADL), which, basically, identify the used components and how they are interconnected. Most of these languages were defined for automatically compiling a component based system from the components and the architecture definition, and for deploying it to a distributed hardware. Some languages, however, support the ana- lysis of component based systems. For example, DARWIN [MDEK95] has an operational semantics, which is defined in terms of the π-calculus [MPW92]. In this paper, we show how to use the Distributed Algorithms Working Notation (DAWN) [WWV+ 97, Rei98] for modelling and for verifying component based systems. Originally, DAWN was designed for modelling and verifying network algorithms. But, the underlying techniques are ready made for component bases systems, which will be demonstrated in this paper. The components will be modelled by algebraic Petri nets and the architecture will be defined by giving a topology for the interconnected components. Given these two parts, we get an overall model of the component based system. Then, we can use the techniques of DAWN for verifying the resulting component based system. For example, we can use model checking for proving some properties. In some cases, we can show even for a class of architectures that all the resulting systems are correct. In this paper, we cannot present this approach in full detail. We will present only the basic idea of DAWN and the different perspective that makes it work for modelling and verifying component based systems: a concrete system can be modelled in two separate parts: the component models and the system architecture. A component model defines the behaviour of a particular type of component. The system architecture defines how the different components interact with each other in a concrete system. Using phrases from software development, modelling components corresponds to programming in the small, whereas defining the system architecture corresponds to programming in the large. Of course, there are many other aspects in component bases software such as reusability and separation of services from their implementation. These aspects are not covered in this paper. Here, we focus on the underlying mathematics of component models, architectures and the resulting systems, which will be presented by the help of a simple example. 2 The Example As an example, we consider a simple algorithm for the calculation of a communication tree for a network of components such that each component has a minimal distance to some distinguished components, which are called root components. The other components are called inner components. So, there are two different kinds of components, which will be discussed below. We assume that the components are connected by a communication network, which will be discussed later. The component models The behaviour of a root component x is quite simple. A root component sends a message to all components that are immediately connected to it. These components are called its neighbours. In this message, component x tells each neighbour component ni , that ni has distance 1 to a root, if ni chooses x as its connection to a root. Figure 1 shows a model of the root component. It is a Petri net1 , where the place init of x is initially marked. As usual in object oriented programming languages, the place init of component x is denoted by x.init. There is only one transition, which adds one token to the interface place message of each neighbour ni of x. Note that the token representing the message is not the usual black token, but a structured token (x, 1), which represents the contents of the message; the first element x of (x, 1) represents the root’s identity x, the 1 Strictly speaking, this is not a Petri net because of the ‘dots’ in it and because of the dashed arcs, which do not have a meaning in Petri nets. We will use this notation for denoting the interface of a component, which defines the possible interconnections to other components. For simplicity, we present the interface of a component and its implementation in a single model; but, this could be easily separated from each other. n1.message [(x,1)] x.init [(x,1)] nk.message Abbildung 1: The root component x second element represents the distance information for this neighbour. Up to now, we are considering each component separately. Hence, we do not know its concrete neighbours n1 , . . . , nk when modelling the component. Therefore, we represent the corresponding arcs by dashed arrows, and some dots indicate that there can be several neighbours. The meaning of this is that, once we have define the architecture, each concrete instance of this component will be connected to the corresponding message places2 of its neighbours. Next, we model the behaviour of an inner component3 x. The inner component x waits for arriving messages. When it identifies a message from a better candidate for a parent (i. e. a candidate with a shorter distance to a root component), it chooses this candidate and stores this candidate along with its distance in its place parent. Initially, there is a token (⊥, ω), where ⊥ denotes a not yet defined parent component and ω denotes infinity. Figure 2 shows the model of the inner component. The transition waits for a message n1.message [(x,n+1)] x.message [(y,n)] n