statecharts
play

Statecharts Used to model behaviour of Autonomous and Reactive - PowerPoint PPT Presentation

Statecharts Used to model behaviour of Autonomous and Reactive Systems (event driven, react to internal timeouts and external stimuli) Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 1/16 Statecharts


  1. Statecharts Used to model behaviour of Autonomous and Reactive Systems (event driven, react to internal –timeouts– and external stimuli) Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 1/16

  2. Statecharts • Visual formalism yet formally and rigourously defined for 1. documentation 2. analysis (model checking as well as testing) 3. simulation 4. code synthesis • Solves FSA problems (by combining with Higraphs): 1. flat ⇒ hierarchy ( ⇒ re-use) 2. represent large number of transitions concisely 3. represent large number of states concisely Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 2/16

  3. Statecharts references • David Harel. Statecharts: A Visual Formalism for Complex Systems. Science of Computer Programming. vol. 8. 1987. pp. 231 - 274. David Harel. On Visual Formalisms. • Communications of the ACM. Volume 31, No. 5. 1988. pp. 514 - 530. • David Harel and Amnon Naamad. The STATEMATE semantics of statecharts. ACM Transactions on Software Engineering and Methodology (TOSEM) vol. 5. Issue 4. October 1996. pp.293 - 333. • David Harel and Hillel Kugler. The Rhapsody Semantics of Statecharts (or, On the Executable Core of the UML). Springer, Lecture Notes in Computer Science 3147. 2004. pp. 325 - 354. Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 3/16

  4. Statecharts tools • STATEMATE [http://www.ilogix.com/products/magnum/index.cfm] • Rhapsody [http://www.ilogix.com/products/rhapsody/rhap_inc.cfm] • Rational Rose [http://www.rational.com] • Stateflow [http://www.mathworks.com/products/stateflow/] • BetterState Lite [http://www.windriver.com/products/html/betterstate.html] • XJTek [http://www.xjtek.com/products/xjcharts/] • Poseidon for UML [http://www.GentleWare.com] • ArgoUML [http://argouml.tigris.org/] • visualSTATE [http://www.iar.com/Products/VS/] • SVM [http://msdl.cs.mcgill.ca/people/tfeng/research.html] Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 4/16

  5. Statecharts = 1. Deterministic Finite State Automata (FSA, DFA) 2. Depth 3. Orthogonality 4. Broadcast 5. History 6. Time 7. syntactic sugar: entry/exit actions, . . . Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 5/16

  6. UML 2.0 Statecharts abstract syntax Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 6/16

  7. Deterministic Finite State Automata (FSA, DFA) State A A entry/ ... �� �� �� �� do/ ... exit/ ... A e Default state (pseudo state) f/a �� �� �� �� g [guard] B g(2,"a") transition event(params) [guard] /output_action(params) C e Not allowed in DFA ! Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 7/16

  8. Depth (XOR) Statechart with depth State automaton give meaning by "flattening" �� �� �� �� �� �� �� �� X �� �� �� �� A A e e f g f g B B f C C Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 8/16

  9. Depth and determinism Statechart with depth State automaton (non deterministic) give meaning by "flattening" �� �� �� �� �� �� �� �� �� �� X �� �� A A e e f f f f B B f C C Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 9/16

  10. Depth and determinism State automaton (non deterministic) A e f f B f C Deterministic state automaton Deterministic state automaton outer transition (STATEMATE) inner transition (UML) A A e e f f B B f f C C Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 10/16

  11. Why “inner-first” in UML Statecharts ? outer1 outer2 e e() g() outer2 e inner1 f(2,"hello") outer3 g inner1 inner2 inner2 e() f(int, string) Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 11/16

  12. Orthogonality (AND) meaning State Automaton Statechart with Orthogonal Components �� �� �� �� �� �� �� �� Y A D k �� �� B,F �� �� h B E k �� �� g �� �� B,E e B,G g h F f[D in(G)] e m|p e e f G e p C g m C,E p C,G n e p p k e p e C,F H I n h p m|p I H Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 12/16

  13. Orthogonality and synchronization Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 13/16

  14. Broadcasting (output events) A D E h B F n g e f/g C G e H m/e I J n/f Input Segment: nmnn Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 14/16

  15. History States Autonomous H resume Red t Manual to_manual Green t Yellow t Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 15/16

  16. Deep History H* A OC2 OC1 C B X I Y D J Z Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 16/16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend