Vered Gafni, The Design Language of Statecharts
Vered Gafni, Simple Statechart Finite State Machine R, S, T – States a, b, c, d - Events Arrows - State transitions (source-less arrow denotes an initial state).
Vered Gafni, Transition Events Syntax
Vered Gafni, Events {a, b, c,.... } atomic events: a or b a occurs or b occurs a and b a occurs and b occurs not(a) a does not occur tm(a,t) t time-units after the occurrence of a tr( C ) condition C becomes true fs( C ) condition C becomes false en(S) state S is entered ex(S) state S is exited
Vered Gafni, Conditions A, B,.... atomic conditions: A or B A is true or B is true A and B A is true and B is true not(A) A is false in(S) True while the system is in state S X=Y, X<Y,…. Boolean relations
Vered Gafni, Actions a,b,… atomic actions tr!(C) make condition C True fs!(C) make condition C False wr!(V) write variable V rd!(V) read variable V atomic actions also considered event generation
Vered Gafni, Example of Compound Transition
Vered Gafni, Transition Connectors
Vered Gafni, L H valv e Water-level sensor Controller Valve command
Vered Gafni, Sub-States: Sequential Refinement S is a super-state w.r.t {S1, S2, S3 } Super-state transitions (priority) History entrance (H* -deep history)
Vered Gafni, Example of Sequential Refinement Equivalence up to priorities
Vered Gafni, Sub-states: Parallel Refinement Events broadcasting
Vered Gafni, דוגמא - בקר שיוט רכב Automatic Cruise Control
Vered Gafni, Automatic Cruise Control
Vered Gafni, Operating
Vered Gafni,
Vered Gafni,
Vered Gafni, Railroad Crossing Control
Vered Gafni, Crossing Control: Sequential Design
Vered Gafni, Crossing Control: Parallel Design
Vered Gafni, Using Timeout Delay Periodic activation deadline
Vered Gafni, Timeout as Delay To activate the furnace open the oil valve, and after 3 seconds operate ignition Idle Ignition_ delay Furnace _Active Activate/Open_oil_valve tm(Activate,3sec)/Ignite
Vered Gafni, Timeout for Periodic Activation Execute control loop at 10Hz rate RTC /tick tm(tick,100mls)/tick WaitTick Control Loop tick done
Vered Gafni, Timeout as Deadline Whenever train enters XR, gate should be closed within 10 seconds; otherwise an alarm will be activated WaitTrain Tin/CloseGate tm(en(Closing),10sec)/Alarm Closed Closing GateClosed FailClosing
Vered Gafni, Synchronization Techniques I
Vered Gafni, Synchronization Techniques II
Vered Gafni, Synchronization Techniques III
Vered Gafni, Transition Functions [K] true[K] where ‘true’ is an event that occurs at every time instant
Vered Gafni, Magnum A Real-Time Design Tool Provides for representation of 3 system views: What: - the activities the system should do, and inter-activities data flow When: - the timing and synchronization of activities activation and data transfer Where: - in what subsystem the each activity should be implemented
Vered Gafni,
Vered Gafni, Basic Components A A1 A2 A3 C A2_1 A2_2 E1 E2 E3 CC u vw q e f h r x s
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,
Vered Gafni,