these developments has been in the field of formal methods. Such methods, typically given by a

Similar documents
Distributed Systems Programming (F21DS1) Formal Verification

PETRI NET MODELLING OF CONCURRENCY CONTROL IN DISTRIBUTED DATABASE SYSTEM

4/6/2011. Model Checking. Encoding test specifications. Model Checking. Encoding test specifications. Model Checking CS 4271

Introduction to Model Checking

Lecture 3 SPIN and Promela

Integration of analytic model and simulation model for analysis on system survivability

Formal Support for QVT-Relations with Coloured Petri Nets

Flight Systems are Cyber-Physical Systems

Petri Nets ~------~ R-ES-O---N-A-N-C-E-I--se-p-te-m--be-r Applications.

CS477 Formal Software Development Methods / 39

Tool demonstration: Spin

The SPIN Model Checker

Systemic Solutions to Deadlock in FMS

The SPIN Model Checker

Introduction to Formal Methods

Performance Testing from UML Models with Resource Descriptions *

ON-LINE QUALITATIVE MODEL-BASED DIAGNOSIS OF TECHNOLOGICAL SYSTEMS USING COLORED PETRI NETS

Colored Petri Net Evaluation Tool. Stephen Rojcewicz CS 2310

MONIKA HEINER.

Transforming UML Collaborating Statecharts for Verification and Simulation

Stochastic Petri nets

Composability Test of BOM based models using Petri Nets

Formal Verification by Model Checking

Mapping of UML Diagrams to Extended Petri Nets for Formal Verification

! Use of formal notations. ! in software system descriptions. ! for a broad range of effects. ! and varying levels of use. !

Model checking Timber program. Paweł Pietrzak

A Modelling and Analysis Environment for LARES

Introduction to Modeling. Lecture Overview

Network Protocol Design and Evaluation

An Exercise in Iterative Domain- Specific Language Design. Marcel van Amstel Mark van den Brand Luc Engelen

What is SPIN(Simple Promela Interpreter) Elements of Promela. Material About SPIN. Basic Variables and Types. Typical Structure of Promela Model

HYBRID PETRI NET MODEL BASED DECISION SUPPORT SYSTEM. Janetta Culita, Simona Caramihai, Calin Munteanu

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001

Formal specification of semantics of UML 2.0 activity diagrams by using Graph Transformation Systems

REAL-TIME OBJECT-ORIENTED DESIGN AND FORMAL METHODS

TOWARDS AUTOMATED VERIFICATION OF WEB SERVICES

SPIN: Part /614 Bug Catching: Automated Program Verification. Sagar Chaki November 12, Carnegie Mellon University

Formal Modeling for Persistence Checking of Signal Transition Graph Specification with Promela

CODING TCPN MODELS INTO THE SIMIO SIMULATION ENVIRONMENT

OPTIMIZING PRODUCTION WORK FLOW USING OPEMCSS. John R. Clymer

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II

Resource-bound process algebras for Schedulability and Performance Analysis of Real-Time and Embedded Systems

VALIDATING AN ANALYTICAL APPROXIMATION THROUGH DISCRETE SIMULATION

What is SPIN(Simple Promela Interpreter) Material About SPIN. Elements of Promela. Basic Variables and Types. Typical Structure of Promela Model

Verification of Web Service Flows with Model-Checking Techniques

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY

Petri Nets ee249 Fall 2000

Promela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN

Q Body of techniques supported by. R precise mathematics. R powerful analysis tools. Q Rigorous, effective mechanisms for system.

Hierarchical Composition and Abstraction In Architecture Models

Modeling a Cache Coherence Protocol with the Guarded Action Language

Analysis of BPMN Models

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab)

Distributed Systems COMP 212. Lecture 1 Othon Michail

Specific Proposals for the Use of Petri Nets in a Concurrent Programming Course

Modeling with Uncertainty Interval Computations Using Fuzzy Sets

A Brief Introduction to Coloured Petri Nets

How useful is the UML profile SPT without Semantics? 1

WEEK 5 - APPLICATION OF PETRI NETS. 4.4 Producers-consumers problem with priority

CS477 Formal Software Development Methods / 32

Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets)

ENTITIES WITH COMBINED DISCRETE-CONTINUOUS ATTRIBUTES IN DISCRETE- EVENT-DRIVEN SYSTEMS

KRON: An Approach for the Integration of Petri Nets in Object Oriented Models of Discrete Event Systems

Automated Freedom from Interference Analysis for Automotive Software

Petri Nets. Petri Nets. Petri Net Example. Systems are specified as a directed bipartite graph. The two kinds of nodes in the graph:

transformation of PROMELA models into Channel Systems,

The Spin Model Checker : Part I/II

The Maude LTL Model Checker and Its Implementation

Formal Methods. CITS5501 Software Testing and Quality Assurance

Scenarios, Quality Attributes, and Patterns: Capturing and Using their Synergistic Relationships for Product Line Architectures

Discrete Event Simulation and Petri net Modeling for Reliability Analysis

Statistical Testing of Software Based on a Usage Model

Practical Design of Experiments: Considerations for Iterative Developmental Testing

A Comparison of the Expressiveness of SPA and Bounded SPN models

INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis I

The Automatic Design of Batch Processing Systems

Technical Research on Describing Reconfigurable Systems by Object Oriented Petri net

Multi-Threaded System int x, y, r; int *p, *q, *z; int **a; EEC 421/521: Software Engineering. Thread Interleaving SPIN. Model Checking using SPIN

Siegfried Loer and Ahmed Serhrouchni. Abstract. SPIN is a tool to simulate and validate Protocols. PROMELA, its

Contemporary Design. Traditional Hardware Design. Traditional Hardware Design. HDL Based Hardware Design User Inputs. Requirements.

CONFIDENCE INTERVALS FROM A SINGLE SIMULATION USING THE DELTA METHOD 1

Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab)

Software Engineering using Formal Methods

Process Model Consistency Measurement

Managing test suites for services

MODEL CHECKING FOR PLANNING RESOURCE-SHARING PRODUCTION

On Nested Depth First Search

T Parallel and Distributed Systems (4 ECTS)

Iterative Specification Refinement in Deriving Logic Controllers

Course Modelling of Concurrent Systems Summer Semester 2016 University of Duisburg-Essen

Patrick Trentin Formal Methods Lab Class, Feb 26, 2016

COMP 763. Eugene Syriani. Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science. McGill University

Modeling Systems Using Design Patterns

IMPERATIVE PROGRAMS BEHAVIOR SIMULATION IN TERMS OF COMPOSITIONAL PETRI NETS

Combining Complementary Formal Verification Strategies to Improve Performance and Accuracy

Abstract. A Simde Exam& of Deadlock and Deadlock

Business Processes Modelling MPB (6 cfu, 295AA)

A STRUCTURAL OPTIMIZATION METHODOLOGY USING THE INDEPENDENCE AXIOM

ISO/IEC INTERNATIONAL STANDARD. Software and system engineering High-level Petri nets Part 1: Concepts, definitions and graphical notation

Transcription:

PCX: A Translation Tool from PROMELA/Spin to the C-Based Stochastic Petri et Language Abstract: Stochastic Petri ets (SPs) are a graphical tool for the formal description of systems with the features of concurrency, synchronization, mutual exclusion and conflict. SP models can be described with an input language called CSPL (C-based SP language). Spin is a generic verification system that supports the design and verification of software systems. PROMELA (Protocol or Process Meta Language) is Spin s input language. This work provides the translation rules from a subset of PROMELA constructs to CSPL, and also offers an experimental tool PCX (PROMELA to CSPL Translator) and approach to explore the specification and analysis of stochastic properties for systems. The PCX tool translates the formal description, written in PROMELA, into an SP, represented by CSPL. The approach requires users to add stochastic property information, during (or after) the translation. Translation of the PROMELA model to a CSPL specification will allow the analysis of non-functional requirements such as reliability, availability, and performance through SPP (Stochastic Petri et Package), a stochastic analysis tool. This is useful in the design and validation of performance where parameters such as failure rate or throughput are available. Moreover, certain structural and architectural features of software can be evaluated and considered within the context of Spin-verifiable properties. This approach provides additional flexibility to the PROMELA specification-modeling paradigm to include stochastic analysis of structural and non-functional properties. Thus, PCX provides a practical bridge between system verification and system validation. Keywords: Petri ets, Spin, PROMELA, translation tool, verification and validation analysis 1 Introduction Ideally verification and validation of a software design specification would be possible before any code was generated. Indeed, in a perfect world we would know that the implementation was correct because we could trust the class libraries, the development tools, verification tools and simulations etc. These features would provide the confidence needed to know that all aspects (complexity, logical and timing correctness) of the design were fully satisfied (i.e., everything was right). Right in the sense that we built it right (its correct with respect to its specification) and it solves the right problem. Unfortunately, our ability to ensure the correctness has not kept pace with the growth in system complexity [1]. Although verification and validation methods have fallen behind the increasing complexity of new and evolving systems, there have been several developments that may close the gap. One of these developments has been in the field of formal methods. Such methods, typically given by a 1

formal specification language, provide frameworks within which people can specify, develop, and verify (and/or validate) systems in a systematic manner. These techniques use mathematical logics to explore the state space of complex systems and to verify their correctness against carefully stated correctness properties or to derive analytic performance measures [2-4]. These properties/measures can be either functional requirements (communications, control, redundancies) or non-functional requirements (performance, reliability, execution deadlines). Tools based on these techniques can be used to show that systems will behave as expected for all possible cases. aturally the precision of such results depends on how closely the model represents the actual system under study (e.g., an existing or proposed system). 1.1 Petri nets are used to assess non-functional characteristics Petri ets (Ps) are a graphical tool for validating the formal description of systems (typically distributed systems) that possess the characteristics of concurrency, synchronization, mutual exclusion and conflict [5]. The stochastic Petri et (SPs) is a P augmented with stochastic attributes, such as a rate or probability of a transition firing. Techniques that utilize SPs are good for evaluating the performability, but they may be too abstract and cumbersome from the standpoint of specifying and evaluating functional behavior. Therefore, one major objective of this work is to provide an integrated approach to assist the user in specifying both functional and non-functional requirements. 1.2 PROMELA/Spin used to assess logical functional properties Spin is a generic system that supports the design and verification of distributed software systems. Spin verification models are focused on proving the correctness of process interactions, and they attempt to abstract as many states as possible from internal sequential computation [6]. PROMELA 2

(Protocol or Process Meta Language) is the input language for Spin [7]. This work provides translation rules from PROMELA to Stochastic Petri ets, and also offers an experimental tool PCX (PROMELA to CSPL Translator) and approach codified by the PCX tool to explore the specification and analysis of stochastic properties. In this way, the merits of a powerful modeling technique for performability analysis (using SPs) can be combined with a well-defined formal specification language (PROMELA) for logical analysis (i.e. verification). By doing this, we can come closer to providing a formal approach to designing a functionally correct system that meets the reliability and performance goals [8, 9]. In the following sections we provide a brief description of the overall PCX translation strategy and related work. We address the question of just how faithful (i.e., equivalent) are the different formalisms in terms of their underlying state space (i.e., comparing the state space generated for the same model represented using both PROMELA and SPs). Section 3 describes the implementation of PCX. Section 4 and 5 present the experimental results, conclusions and future research directions respectively. The appendix gives the basic set of canonical translations. 2 Translation tool from PROMELA to CSPL The PROMELA/Spin to P translations were designed to facilitate automatic decomposition of the PROMELA/Spin model (construct-by-construct) into P sub-components, and then the subcomponents are linked together to form a complete system Petri ets. 2.1 Related work The PCX tool abstracts the control flow (i.e., structural characteristics and dynamic aspects) from the PROMELA model and translates the flow control into a Stochastic Petri et model, represented using CSPL. During or after the translation, the tool allows users to add stochastic properties that the 3

PROMELA models do not provide. Holzmann presented an approach for the translation of Petri ets into a PROMELA model [10]. The approach uses the idea that Petri ets can easily be represented with a small subset of PROMELA constructs. Grahlmann has developed the PEP tool (Programming Environment based on Petri et) that incorporates a feature that translates Ps into PROMELA for analysis using Spin based on the same idea [11]. In their approach the resulting PROMELA models have the same state space as the Petri et model does. However, their method only translates from Petri ets (i.e., not Stochastic Petri ets) to PROMELA. The state space is the same for the translation from Ps to PROMELA using the PEP tool. Using the PCX tool translation, the state space of PROMELA model is different from that of the P model because the PCX translation rules utilize a simple abstraction method. Intuitively, the expressive power of PROMELA is much greater than that of Ps (which only have places. transitions, arcs and tokens). This constitutes the major reason for the difference. The general approach used for the PCX tool is abstraction. PCX captures the control flow of the PROMELA input language as the basis for the non-functional structural (stochastic) analysis. Sheldon presented the CSP tool (Communicating Sequential Processes (CSP): CSP-to-Stochastic Petri ets) that enables designers to investigate functional and non-functional requirements by translating CSP to Stochastic Petri et while assigning stochastic properties [12]. From a methodological point of view, our work was mainly inspired by the experience of the CSP tool. The main differences between PCX and CSP are the input language. The back-end part of the PCX tool is similar to that of the CSP tool. 2.2 Methodology This work offers an approach to verify system correctness (against logical assertions or systems requirements) using model checking and validate system behavior (reliability and performance) 4

based primarily on the structural characteristics of a formal specification. The PCX tool provides a notion of refinement that allows the designers to describe a system at an appropriate abstract level. Spin model checking PROMELA/Spin Model (1) Functional Specification Refine and verify User Specification eeds PCX Translator (2) & (3) on-functional Specification Petri ets model checking CSPL/SPP Model (4) Refine and validate Final Design Model (5) Figure 1. The PCX approach for the system model analysis Figure 1 shows how this approach involves abstraction from the requirements specification into a design specification and then further evaluations based on stochastic analysis of the system models. First the user develops the PROMELA model based on the requirement specification that can be verified by the Spin model Step Table 1. Methodology: steps for specification and analysis Description of steps used in the approach checker. Then the 1 PROMELA/Spin model for analyzing the logical consistency verified written PROMELA, model, in is 2 Translate from PROMELA to Stochastic Petri ets. 3 Assign performance and reliability parameters among subsystem components. Analyze the SP for stochastic properties [using SPP] (validate performance 4 and reliability goals using stochastic system models). translated into SP 5 Final design based on results from Spin and SPP tool analysis model, written in CSPL. During or after this translation, the PCX tool allows users to add stochastic parameters that can be based on the system requirement specification. The user analyzes the SP model for stochastic properties using SPP to obtain the final design model. If the final design model does not meet both functional and non-functional requirements, the above steps are repeated until the user requirements are satisfied. The PCX tool is used in the context of the 5 steps listed in Table 1. Each step in Table 1 also is marked in Figure 1 with same step number. 5

The PROMELA-to-SP translation rules used for process decomposition and composition are codified in the PCX tool. PCX decomposes individual PROMELA constructions into P structures. The elemental structures are linked together in a hierarchical fashion according to their adjacency and nesting within the PROMELA specification. Having created this net of linked structures, PCX traverses and expands sub-sps into the complete system described by a P. Also, while PCX decomposes the PROMELA constructions, the service and failure rate annotations are added via user inputs for being incorporated later into the CSPL specification file. After the preliminary structure of the SP is complete, PCX must reconcile synchronization points because the PROMELA message channel must rendezvous at a particular point in which the message is sent/received. PCX finally generates an SP graphic specification file and a CSPL specification file. The user can view the SP's distribution of places and transitions as a graph after the translation is accomplished. The resultant P models (CSPL file) with the different stochastic parameters can be analyzed using the SPP tool. This entire process occurs at various levels of user controllable interaction. In essence, the approach provides for systematic and automatic translation and subsequent augmentation (e.g., failure rates, service rates, and deadlines) of the PROMELA model into an SP model for evaluating both functional and non-functional properties. 2.3 Mapping from PROMELA to SP An initial set of translation rules from the PROMELA specification language into the SP was defined by Chuck Rodacker [13]. The general principle behind the translation is the following. In PROMELA, each statement can be viewed as a condition (or event), which are represented by a place. After execution of one statement, another statement can execute, while these actions themselves are viewed as transitions (i.e., SPs provide the mechanism to analyze the system performance based in structural characteristics). Therefore it is appropriate to abstract control flow 6

information from the PROMELA model. The control flow then provides the basis for analyzing performance. This is Example 1 Sequence: stmnt P; stmnt ; stmnt R Example 2 do_od: do ::stmntp->stmnt; stmnt :: stmnt M->stmnt od P P M P Example 3 do_break: do ::stmnt M->stmnt :: stmnt P->break od M Example 4 if_fi: if ::stmnt P->stmnt :: stmnt M->stmnt fi P M the essential information that is needed and PCX captures the control flow information of an R R break entire PROMELA specified model. This translation Figure 2. The examples of the translation from PROMELA to P approach is similar to the methods in [11]. Moreover, PCX focuses on abstracting control flow information and therefore the content of a statement is not needed in the resulting SP model. PCX allows users to assign rates to each timed transition for the basis of performability analysis, otherwise a default value of 1.0 is assigned. PCX allows the user to set probability parameters to PROMELA models (such as if_fi short state1 = 1, state2=10; proctype A() { ; if ::state2=state2+state1 :: fi; } init { run A() } The set of reachable states for the if-fi construct State M0 M1 M2 M3 M4 M5 M6 Token in place P00 P01 P02 P03 P04 P05 P06 p00 p01 sdt1 sdt2 p02 p03 state2=state2 +state1 p04 p05 Figure 3. The if-fi translation example p06 7

constructs, do_od constructs). In Example 4 of Figure 2, PCX assigns stochastic rate parameters for transition P and transition which in turn determines the ratio of time a token is flowed to either or. The PROMELA to SP translation is designed to facilitate automatic decomposition of the PROMELA constructs into SP sub-components and their subsequent compositions into a complete system SP. S_0 (a) S_1 S_2 run A() state2=state2 +state1 state2=state2 +state1 S_3 S_4 S_5 end sdt 1 M3 M0 M1 M4 M5 M6 (b) sdt 1 dt1 Figure 4. The reachability graph of the if-fi example M3 Some example translations are given in Figure 2. 3 Results Example A contains an if_fi construct. There is one statement each before and after this construct. The resulting SP shows that a conflict transition occurs from place p01. For conflict transitions, the PCX tool can allow users to set probability parameters (or use default values). The parallel part of the SP model (from places p01 to p04) represents if_fi construct in PROMELA. The light bars in Figure 3 represent timed transitions for which rates must be assigned 1. There are 7 reachability states M0, M1, M2, M3, M4, M5 and M6 when a token is in p00, p01, p02, p03, p04, p05, p06 respectively. The reachability graph of the resulting SP model is shown in Figure 4(b). Compared with the reachablity graph obtained directly from the PROMELA model shown in Figure 4(a), the state S_0 which is initialized in Figure 4(a) for run A( ), can be combined with S_1 because run A( ) does not provide a new state in this case. Also, the state S_5, S_6 in Figure 4(b) that represent the end process, do not provide new states. During the translation, sdt1 and sdt2 are provided for adding probability parameters, so the state M2 and state M3 in Figure 4(b) are added compared with the 1 Again, the PCX tool allows users to set these rates (or use default values). 8

short state1 = 1, state2=10; proctype A() { do ::state2=state2+state1; state2=state2+state1 ::; ; if state2=state2+state1 fi od } init { run A() } The set of reachable states for the do-od construct State M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 Token in place P00 P01 P02 P03 P04 P05 P06 P07 P08 P09 P10 P11 dt:muxx1 p02 sdt1 sdt2 p03 p05 state2=state2 +state1 p00 p04 p06 state2=state2 +state1 p01 sdt3 p09 p07 p08 sdt4 0 state2=state2+state1 1 dt1 Figure 5. The do_od translation example reachability graph in Figure 4(a). In example B we see the if_fi, do_od, and sequential construct used. The resulting SP is shown in Figure 5. The SP model displays a sequential operation (from state p00 to state 1), a parallel operation (from place p02 to place 1, and from place p8 to place 1), and a repeating loop (from place p01, then p02 then to place M0 M1 d:muxx1 p01). There are 12 reachability states M0, M1, M2, M3, M4, M5, M6, sdt1 M2 sdt2 M7, M8, M9, M10, M11 which corresponds to a token is in places p00, p01, p02, p03, p04, p05, p06, p07, p08, p09, 0, 1 respectively. 4 Conclusion and future study The objective of this work was to show the feasibility of translating M3 M5 state2=state2+state1 M4 M6 M7 M8 sdt3 sdt4 M9 M10 state2=state2 +state1 M11 Figure 6. The SP model of the do_od construct 9

PROMELA into SPs for the purpose of reliability and performability analysis. Such translations can give insight (1) into the feasibility of meeting non-functional requirements, (2) help to identify the best candidate design based on a formal description of the system, and (3) help to identify failure modes and fault handling mechanisms. This approach enables the stochastic properties of the system specification to be ascertained while allowing the parameters used in the analysis to be formally captured in the PROMELA/Spin model. Subsequent analyses can be run without having to rewrite all of the pertinent values. Only those parameters that are identified as critical in terms of their impact to the integrity of the overall system (i.e., sensitivity analysis) need be perturbed. PCX combines the power of two other tools namely dot (for viewing the graphical P representation) and SPP. PCX offers a selection of command line options. Most of PCX's current features are driven by the SPP functionality. An interactive menu is used to control run parameters related to the type of analysis (e.g., precision, iterations, generating a reachability graph, running continuous time versus discrete time Markov analysis, etc.). PCX also allows the designer to parameterize and control the characteristics of the system under study (e.g., setting priorities, rates or probabilities among transitions, etc.). In general, the PCX tool provides a new level of abstraction and basis for understanding interactive concurrent process algebraic specifications by leveraging the power of dot and SPP. In the future, it will be necessary to define additional PROMELA/P canonical translation rules for a larger set of the PROMELA language. In addition, we plan to develop more examples that demonstrate the usefulness of this approach. 5 References 1. Pressman, R.S., Software Engineering: A Practitioner's Approach. Fourth ed. 1997: The McGraw-Hill Companies, Inc. 10

2. Craigen, D. Formal Methods Adoption: What's working, What's not! in The 6th International SPI Workshop on Practical Aspects of Model Checking. 1999. Toulouse, France. 3. Gerhart, S.L., Application of Formal Method: Developing Virtuous Software. IEEE Software, 1990(Sept. 1990): p. 7-10. 4. Reisig, W. Combining Petri ets and Other Formal Methods. in 13th International Conference on Application and Theory of Petri ets. 1992. 5. Marsan, M.A., Balbom, G., Gonte, G., Donatelli, S., Franceschinis, G., Modeling With Generalised Stochastic Petri ets. 1995, ew York, Y 10158, USA: John Wiley And Sons. 6. Holzmann, G.J., The Model Checker SPI. IEEE Transactions on Software Engineering, 1997: p. 279-295. 7. Holzmann, G.J., Design and Validation of Protocols: A tutorial, in Computer etworks and ISD Systems. p. 981-1017. 8. Wang, C., Trivedi, K.S., Integration of specification for Modeling and Specification for System Design. 1994. 9. Wang, C., Some Problems in the Specification and Analysis of Computers and etworks. 1995. 10. Holzmann, G.J., SPI Verification Examples and Exercises., http://cm.belllabs.com/cm/cs/wat/spin/man/exercises.html. 11. Grahlmann, B. and C. Pohl. Profiting from Spin in PEP. in The 4th International SPI Workshop. 1998. Paris, France. 12. Sheldon, F.T., Specification and Analysis of Stochastic Properties for Concurrent Systems using CSP, in Department of Computer Science and Engineering. 1996, The University of Texas at Arlington: Arlington, Texas. 13. Rodacker, C., PCX- A Translation Tool, Master Project, Unpublished Report, in Department of Computer Science. 1999, University of Colorado Springs: Colorado Springs. 11

Appendix A: PROMELA to SP translation rules The collection of the standard translations from PROMELA to SPs is provided here. Users can combine the basic units to form the actual model. The Sequence Construct The statement stmnt P,, R in PROMELA represents three transitions (transition P, and R shown in SP model). The sequential execution flows from one place (e.g., shown in the SP model is assigned with one character and serial Sequence: stmnt P; stmnt ; stmnt R do_od: do ::stmnt P->stmnt ; stmnt :: stmnt M->stmnt od do_break: do ::stmnt M->stmnt :: stmnt P->break od if_fi: if ::stmnt P->stmnt :: stmnt M->stmnt fi number by the PCX tool during P P M P M P M the translation) to another place (e.g., shown in the SP model). In this case, the state break R R Figure A-1. Sequence statement, do-od statement, do_break statement, fi_fi statement space in PROMELA model is the same as that in SP model. The do_od construct and the do_break Construct The do_od construct and the do_break construct have conflicting transitions. The resulting SP models are represented either with timed transitions (i.e., a rate parameter is assigned) or immediate transitions (i.e., a probability parameter is assigned). In the PROMELA model there are various 12

reachable states (depending on the content of statement P,, R, M, ), while in the P model, there are only 4 states for both constructs. Usually, the state space in PROMELA models is much more than that in SP models. The if_fi Construct and the Condition Construct The if_fi construct has same SP representation as the condition construct. I fact, the if_fi construct can replace the condition construct. The if_fi construct has conflict transition. The resulting SP models are represented either with timed transition or immediate transition. During this translation PCX tool allows users to assign rates to each timed transitions, otherwise PCX tool will assign default value to them. The state space in PROMELA model is same as that in SP model. The goto_label Construct and the else Construct The goto and label construct and the label construct have same situation as do_od construct and do_break construct. goto and label: L1: if :: guard M->stmnt n-> goto L1 :: guard P->stmnt fi L1 P P1 P3 M else: L1: if :: guard M->stmnt n-> goto L1 :: else->stmnt fi else P1 L1 P3 M conditional: condition->stmnt M: stmnt condition Send/receive: send: port!msg1 receive: port?msg2 Port?msg2 Port!msg1 p5 P2 P4 Goto L1 P2 P4 Goto L1 p6 Figure A-2. Translation rules for goto, label, else, conditional and send/receive statements 13

Message Channel The message construct in PROMELA transfers messages through the channels. This type of communication is modeled in a SP by firing a transition for both of the sender and the receiver to represent the sending and receiving activity respectively. The resulting SP models are represented either with timed transition or immediate transition. The state space in PROMELA model is same as that in SP model. 14