© SERG Software Design (Behavioral) Behavioral Design Topics in Behavioral Design Based on Material in [Rosenblum94][Budgen94] [Ghezzi91] [Harel88]

Slides:



Advertisements
Similar presentations
Use Case Diagrams Damian Gordon.
Advertisements

An Introduction to Petri Nets
Principles of Engineering System Design Dr T Asokan
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Based on: Petri Nets and Industrial Applications: A Tutorial
Interaction Modeling for Testing We would generate the test cases based on our understanding of the interactions that may happen. The source is, again,
Denise Landau Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1.
Use Case & Use Case Diagram
IE 469 Manufacturing Systems
Discrete Interaction Design Specification Prof. Dr. Matthias Rauterberg Faculty Industrial Design Technical University of Eindhoven
CPSC 333: Foundations of Software EngineeringJ. Denzinger Small Test: Bank account manager System has to run on an automated teller machine. User must.
Synthesis of Embedded Software Using Free-Choice Petri Nets.
Petri Nets Overview 1 Definition of Petri Net C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, p n } Transitions T = { t 1, t 2, t 3, …, t n } Input.
Embedded Systems Details. Object Model: Four main system objects or classes Controller object might be made up of several controllers is the brains of.
More on Dynamic Models - Page L14-1 Full 2002M.E. Fayad Lesson 14: More about Dynamic Models Object- Oriented Modeling & Applications.
CSC 402 Requirements Engineering 1 Requirements Techniques, cont. Formal requirements analysis techniques include: – DFD (covered) – ERD (covered) – Finite.
1 Gas Station and Cruise Control Specifications Ronnie Apcar Edwin Chiu Hasmik Jerejian November 2, 2000 CSCI 599 Formal Methods November 2, 2000 Concurrency.
Modeling Worldviews Activity Scanning – Petri Nets and Event Graphs Event Scheduling – Event Graphs State Machines Process Interaction –Block Flow Diagrams.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
12/07/2007Jiacun Wang1 SE-561 Math Foundations Petri Nets - II Dr. Jiacun Wang Department of Software Engineering Monmouth University.
Lecture 6 & 7 System Models.
Requirements Techniques, cont. Brief review Formal Requirements Techniques –Finite State Machines –Petri Nets.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
CS 290C: Formal Models for Web Software Lecture 2: Modeling States with Statecharts Instructor: Tevfik Bultan.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
PETRINETS Nipun Devlekar Zauja Lahtau. PETRINETS DEFINITION : DEFINITION :  PETRINET (place/ transition net): a formal, graphical, executable technique.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 3: Requirements Specification, C++ Basics.
Deterministic Finite State Machines Chapter 5. Languages and Machines 2.
Software Transition Testing Presented By: Varun Phanda
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
Stochastic Activity Networks ( SAN ) Sharif University of Technology,Computer Engineer Department, Winter 2013 Verification of Reactive Systems Mohammad.
By: David Harel & Eran Grey Presenter: Elizabeth Antony CISC 836.
Slide 1 Project 1 Task 2 T&N3311 PJ1 Information & Communications Technology HD in Telecommunications and Networking Task 2 Briefing The Design of a Computer.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
Modelling by Petri nets
Ch5: Software Specification. 1 Petri Nets  Introduced by C. Adams Petri in  Widely used in the modeling and analysis of computer systems.  Basic.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
Week 7 - Systems Engineering and Analysis
Documenting Control Problems with Statecharts Charles Wallace Michigan Technological University
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
School of Computer Science & Software Engineering
Review n System dynamics : A sequence of state transition n model : A set of rules for state transition System S X Y Discrete event system FSM (Automata)
Petri-Nets and Other Models
The Dynamic Analysis Model StateCharts Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
CS646: Software Design and Architectures Design notations Dynamic  Data flow diagrams (DFDs).  State transition diagrams (STDs).  Statecharts.  Structure.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VIII. Specifications (II)
Requirements Techniques, cont.
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
Concurrent Systems Modeling using Petri Nets
Finite State Machines Dr K R Bond 2009
CSS 496 Business Process Re-engineering for BS(CS)
Dr. Eng Amr T. Abdel-Hamid
Clockless Computing COMP
State Machine Diagrams
Stochastic Activity Networks
Workflow Management Systems
CAP 4800/CAP 5805: Computer Simulation Concepts
بسمه‌تعالي فصل چهاردهم شبکه‌هاي پتري.
Dynamic Modeling Lecture # 37.
Using Use Case Diagrams
Petri Net :Abstract formal model of information flow Major use:
Petri Nets Laurie Frazier.
Presentation transcript:

© SERG Software Design (Behavioral) Behavioral Design Topics in Behavioral Design Based on Material in [Rosenblum94][Budgen94] [Ghezzi91] [Harel88]

© SERG Software Design (Behavioral) Behavioral Design Topics State Transition Diagrams Petri Nets Higraphs and Statecharts

© SERG Software Design (Behavioral) State Transition Diagrams

© SERG Software Design (Behavioral) State Transition Diagrams (STD) Systems exist in a finite set of possible states. External events are triggers that lead to transitions between the states. Since most systems have many states, a partial model of the system may be a good compromise. STDs are the cornerstone of more powerful diagrams for specifying system behavior, such as Petri Nets and State Charts.

© SERG Software Design (Behavioral) Partial Unix vi STD o Line Command ZZ Text Insertion Mode Command Mode / : return ESC i l

© SERG Software Design (Behavioral) Formal Definition of an STD

© SERG Software Design (Behavioral) Combination Safe STD Safe Locked1/3 Unlocked Safe Unlocked 2/3 Unlocked 1L2L3R Sound Alarm any other dial movement any other dial movement any other dial movement

© SERG Software Design (Behavioral) IDE STD Compiling events no events hiccup Running Start resume pause stop finished success Compiled error stop run Executing Pausing

© SERG Software Design (Behavioral) Petri Nets

© SERG Software Design (Behavioral) A Simple Petri Net P1P2t1t2 t3P3 P4

© SERG Software Design (Behavioral) A Marked Petri Net P1P2t1t2 t3P3 P4

© SERG Software Design (Behavioral) A Marked Petri Net After Firing t1 P1P2t1t2 t3P3 P4

© SERG Software Design (Behavioral) Definition of a Petri Net PNet = (P, T, A, M0) –P is a finite set of places (labeled circles), where a place holds tokens. –T is a finite set of transitions (bars), where a transition represents an activity. –A is a finite set of directed arcs, where an arc connects a place and a transition. –M0 is the initial marking of PNet, where a marking is an arrangement of tokens in places representing state.

© SERG Software Design (Behavioral) Petri Net Execution Model Input Place: Place P is an input place for transition T if there is an arc from P to T. Output Place: Place P is an output place for transition T if there is an arc from T to P. Enabled Transition: A transition is enabled if there is at least one token at each of its input places.

© SERG Software Design (Behavioral) Petri Net Execution Model (Cont’d) Firing a Transition: An enabled transition is non deterministically selected and fired by removing one token from each of its input places and depositing one token at each of its output places. Firing Sequence: A firing sequence such that t0 is enabled and fired in M0, t1 is enabled and fired in M1,...

© SERG Software Design (Behavioral) Petri Net Firing

© SERG Software Design (Behavioral) A Petri Net Describing an ATM Machine Ready Valid Card Correct Pin Card Accepted Valid Request Sufficient Funds Sufficient ATM Cash Card in Slot Notes in Dispenser

© SERG Software Design (Behavioral) A Marked Petri Net Semaphore IN1IN2 CR1CR2 SEM OUT1OUT2 IN = Input of Process OUT = Output of Process CR = Critical Region SEM = Semaphore

© SERG Software Design (Behavioral) Enabled Transitions IN1 IN2 CR1 CR2 SEM OUT1OUT2

© SERG Software Design (Behavioral) After Non-Deterministic Firing IN1IN2 CR1 CR2 SEM OUT1OUT2

© SERG Software Design (Behavioral) Enabled Transition IN1 IN2 CR1CR2 SEM OUT1OUT2

© SERG Software Design (Behavioral) After Firing IN1 IN2 CR1 CR2 SEM OUT1OUT2

© SERG Software Design (Behavioral) Petri Net Static Analysis Invariants are properties of a Petri net that hold (are true) in all markings. For example, the sum of all tokens in CR1, CR2, and SEM are equal to 1 in all reachable markings. That is, |CR1| + |CR2| + |SEM| = 1

© SERG Software Design (Behavioral) Deadlock and Starvation A Petri Net with a given marking is in deadlock iff no transition is enabled in that marking. A Petri Net with a given marking is in starvation iff one or more transitions have been permanently disabled. A Petri Net is live if every transition can eventually be fired.

© SERG Software Design (Behavioral) A Deadlocked Petri Net

© SERG Software Design (Behavioral) A Petri Net that can Enter a Deadlocked State

© SERG Software Design (Behavioral) A Deadlocked Petri Net

© SERG Software Design (Behavioral) Modification into a Live Petri Net

© SERG Software Design (Behavioral) A Petri Net that can go into Starvation t1t2 t3 t4

© SERG Software Design (Behavioral) Starving Transitions t2 and t4 t1t2 t3 t4

© SERG Software Design (Behavioral) Shortcoming of Basic Petri Nets The Simplicity of building blocks leads to complexity in nets. For example, a semaphore of N processes requires 2N transitions and 3N+1 places. Would like: –Enable and fire as computations. –Tokens as data, not just control. –Ability to reduce high-level Petri nets to basic Petri nets for analysis.

© SERG Software Design (Behavioral) Higher-Level Net Semaphore transition predicate true 3 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) Enabled Transition transition predicate true 3 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) After Firing transition predicate true 2 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) Enabled Transitions transition predicate true 2 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) After Firing transition predicate true 1 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) Enabled Transition transition predicate true 1 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) After Firing transition predicate true 2 token value s > 0 arc expression s+1 p p p s-1 s s p

© SERG Software Design (Behavioral) A Software Change Process New MRs (MR) true Tom Maria Tony Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer)

© SERG Software Design (Behavioral) After Firing (New Assigned MR) New MRs (MR) true 7,Tom Maria Tony Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer)

© SERG Software Design (Behavioral) After Firing (New Assigned MR) New MRs (MR) true 7,Tom Maria Tony 8,Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer)

© SERG Software Design (Behavioral) After Firing (New Completed MR) New MRs (MR) true 7,Tom Maria Tony 8,Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer)

© SERG Software Design (Behavioral) After Firing (New Assigned MR) 1933 New MRs (MR) true 7,Tom Maria 11,Tony 8,Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer)

© SERG Software Design (Behavioral) After Firing (New Approved MR) 1933 New MRs (MR) true 7,Tom Maria 11,Tony Olga Approved MRs Assigned MRsCompleted MRs (MR) (MR, Developer) (MR, Developer) (MR, Developer) (Developer) (MR, Developer) 8

© SERG Software Design (Behavioral) Higraphs and Statecharts

© SERG Software Design (Behavioral) Higraphs Higraphs are based on: –Euler graphs –hypergraphs –Venn diagrams Graph Hypergraph QR P Q^R P^Q^R P^QP^R

© SERG Software Design (Behavioral) E Higraphs Supports Cartesian Products. B A O P T S R D J H I G F L M N K Q C

© SERG Software Design (Behavioral) Formal Definition of a Higraph

© SERG Software Design (Behavioral) Specialized Higraphs: State Charts State Charts are a higraph-based extension of standard state-transition diagrams, where blobs represent states and arrows represent transitions. State Charts = state diagrams + depth + orthogonality + broadcast communication

© SERG Software Design (Behavioral) Depth of State Charts e, f, g, h: events that trigger the transitions g(c): is the transition by event g when condition c is true. Being in state D means being in one of states A or C. The f arrow leaving D applies to both A and C. A is the default state. C is the default state when in D. g(c) A B C f f e h A C f B e h D

© SERG Software Design (Behavioral) F Orthogonality of State Charts Y B C H E G I AD e f [in{G}] n e g h k em p C,G B,E C,F C,E B,G B,F HI k h e n k p m or p ef e p g g e h e

© SERG Software Design (Behavioral) Broadcasting of State Charts Y A H D B C E G F k e n f/g g e IJ n/f m/e

© SERG Software Design (Behavioral) in flight State Chart Describing ATC cruising stacked landing approach on ground touch down take off taxiing parked

© SERG Software Design (Behavioral) CPU Main Memory State Chart Describing a Computer Computer Fetching Instruction Execution Instruction Waiting for Request Memory Write Cycle Memory Read Cycle getAddrputAddr instr. cmpl. instr. avail. Put Addr. Get Addr. Data Written Data Read

© SERG Software Design (Behavioral) Display State of Digital Watch displays update hour min date sec c c c c time date alarm stopwatch c b d d a a a up-alarm c hoursec min b c 2-min [not in(stopwatch)]

© SERG Software Design (Behavioral) Stopwatch State of Digital Watch time a disp run zero reg lapoff on d [in(off)] b b d [in(on)] dbb stopwatch

© SERG Software Design (Behavioral) High-Level Description of Digital Watch dead alive main power displays beep beep-rt t-hits-tm [in(enable)] weakstrong bt-weak onoff b b-up enable disable alarm-state d[in(alarm)] light

© SERG Software Design (Behavioral) State Chart of Digital Watch alarm-state dead alive hour min date sec c c c c time date alarm c b d d a a up-alarm c hour sec min b c disp run zero reg lapoff on d b b d dbb stopwatch beep beep-rt t-hits-tm [in(enable)] update displays main 2-min [not in(stopwatch)] bat-in bat-rn weak strong power bt-weak onoff b b-up light disable enable d[in(alarm)]

© SERG Software Design (Behavioral) References [Rosenblum94] D. Rosenblum, A. L. Wolf, Formal Software Engineering, Tutorial SIGSOFT’94 FSE, New Orleans, Dec., [Budgen94] D. Budgen, Software Design, Addison- Wesley, [Ghezzi91] C. Ghezzi, M. Jazayeri, D. Mandrioli, Fundamentals of Software Engineering, Prentice-Hall, [Harel88] D. Harel, On Visual Formalisms, CACM, Vol. 31, No. 5, 1988.