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

statecharts
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 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

slide-3
SLIDE 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

slide-4
SLIDE 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

slide-5
SLIDE 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

slide-6
SLIDE 6

UML 2.0 Statecharts abstract syntax

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

slide-7
SLIDE 7

Deterministic Finite State Automata (FSA, DFA)

  • A

A

  • Default state (pseudo state)

A entry/ ... do/ ... exit/ ...

f/a C B e g [guard]

State transition

e

Not allowed in DFA !

g(2,"a")

event(params) [guard] /output_action(params)

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 7/16

slide-8
SLIDE 8

Depth (XOR)

  • e

A C B f f C A B f e g g

State automaton Statechart with depth by "flattening" give meaning

X

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 8/16

slide-9
SLIDE 9

Depth and determinism

  • A

C B f f C A B f

Statechart with depth by "flattening" give meaning State automaton (non deterministic)

e e f f X

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 9/16

slide-10
SLIDE 10

Depth and determinism

f C A B f e f C A B f e f

Deterministic state automaton

inner transition (UML)

f C A B f e

Deterministic state automaton

  • uter transition (STATEMATE)

State automaton (non deterministic) Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 10/16

slide-11
SLIDE 11

Why “inner-first” in UML Statecharts ?

  • uter2

inner1 inner2

  • uter1
  • uter3

e e f(2,"hello") g

  • uter2

e() inner1 e() inner2 f(int, string) g()

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 11/16

slide-12
SLIDE 12

Orthogonality (AND)

  • meaning

Statechart with Orthogonal Components State Automaton

B,F B,E C,E H C,G B,G C,F I k e g e e f e p p n m|p m|p k p p g B C E G F H I Y A D e n e m k g p h e p h

f[D in(G)]

e h

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 12/16

slide-13
SLIDE 13

Orthogonality and synchronization

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

slide-14
SLIDE 14

Broadcasting (output events)

A H D C G E F I J B e f/g n g h m/e n/f e

Input Segment: nmnn

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 14/16

slide-15
SLIDE 15

History States

H Red Green Yellow Manual t t to_manual resume t Autonomous

Modelling of Software-Intensive Systems (MoSIS) hv@cs.mcgill.ca Statecharts 15/16

slide-16
SLIDE 16

Deep History

H* A B OC1 OC2 C D X Y Z I J

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