SpecificationofaGasStationusingaFormalism IntegratingFormalDatatypeswithinStateDiagrams Christian Attiogb´ e, Gwen Sala ¨ un IRIN Universit´ e de Nantes attiogbe,salaun @irin.univ-nantes.fr Pascal Poizat LaMI - UMR 8042 CNRS Universit´ e d’ ´ Evry Val d’Essonne poizat@lami.univ-evry.fr Abstract In this paper, we propose a generic approach for inte- gratingdatatypesexpressedusingformalspecificationlan- guages within state diagrams. Our main motivations are (i)tobeabletomodeldynamicaspectsofcomplexsystems with graphicaluser-friendly languages, and (ii) to be able to specify in a formal way and at a high abstraction level the datatypes pertaining to the static aspects of such sys- tems. The dynamic aspects may be expressed using state diagrams(suchasUMLorSDL)andthestaticaspectsmay be expressed using either algebraic specifications or state oriented specifications (such as Z or B). Our approach in- troducesaflexibleuseofdatatypes.Italsomaytakeintoac- countdifferentsemanticsforthestatediagrams. Weherein focusonacasestudytodemonstratethepragmatismofour approach. Keywords: Formal Methods Integration, State Dia- grams, Algebraic Specifications, Z, B. 1 Introduction The joint use of formal and semi-formal specification languages is a promising approach, with the objective of taking advantage of both approaches: specifier-friendliness and readability from semi-formal approaches, high ab- straction level, expressiveness, consistency and verification means from formal approaches. In this paper, we propose an approach dealing with this issue. It enables one to spec- ify the different aspects of complex systems using an inte- grated language. Static and functional aspects are specified using static formal specification languages (algebraic specifications [4], state oriented languages such as Z [15] or B abstract ma- chine notation [1]). This makes the verification of speci- fications possible but also the description of datatypes at a very high abstraction level. The flexibility we propose at the static aspects specification level enables the specifier to choose the formal language that is the more suited to this task: either the one (s)he knows well, the one with tools, or the one that makes the reuse of earlier specifications possi- ble. Dynamic aspects (i.e. behaviour, concurrency, commu- nication) are modelled using state diagrams. Our proposal is generic. Different dynamic semantics may be taken into account, hence our approach may be used for Statecharts [11], for the different (yet growing number) of UML state diagrams semantics [14, 13, 17, 3, 16, 12], and more gener- ally for any state / transition oriented specification. In our approach, the specification is control-driven: the dynamic aspects are the main aspects within a specification and state how the static aspects datatypes are used. On a larger scale, our work deals with the formal specifications integration and composition issues, where we yet have some general re- sults [2]. At the global specification level, our approach also addresses the consistency of the static and dynamic parts. This paper is structured as follows. In Section 2, we sum- marize the formal foundations of our approach: syntactic extensions used to integrate formal datatypes within state diagrams and insights on the integration semantics. The main part of this paper, Section 3, is devoted to the illustra- tion, in a pragmatic way, of how our approach may be used to specify a real system (a gas station). To end, Section 4 concludes the paper and presents some perspectives. 2 FormalFoundationsoftheCombination In this section we give an introduction to the formal as- pects of our integration of formal datatypes within state di- agrams. We first present the syntactic extensions for this integration, and then give insights into its semantics. The reader can refer to [7] for a comprehensive presentation. Syntax. We here focus on the syntactic extensions we add to state diagrams to take into account the formal datatypes integration. We advocate for a control-driven ap- 0-7695-1926-1/03/$17.00 (C) 2003 IEEE