Programs and State Machines Program & FSM connection What is - - PowerPoint PPT Presentation
Programs and State Machines Program & FSM connection What is - - PowerPoint PPT Presentation
Programs and State Machines Program & FSM connection What is the connection between programs and finite state machines? P&SM2 Program & FSM connection 2 What is the connection between programs and finite state
P&SM–2
Program & FSM connection
What is the connection between programs and finite
state machines?
P&SM–3
Program & FSM connection – 2
What is the connection between programs and finite
state machines?
The program control graph and its corresponding FSM
are duals of each other
Not standard graph definition of a dual Nodes become edges and vice-versa
P&SM–4
Program & FSM connection – 3
Program Control Graph Corresponding FSM In FSM actions are on the edges
P&SM–5
Communicating state machines
State machines can influence each other
A transition's action may cause an event in another
machine
A transition's guard may query the state of another machne
P&SM–6
Communication example
Control Display
Control performs operations Display shows status
P&SM–7
Communication example – 3
In each machine, considered independently, there are no
unreachable states
In Control can go from state A to state D and back
again
When considered together, the previous path is impossible
Cannot go from state B to state D unless Display is in
the Off state
Control cannot be in state B unless Display is in the
On state.
Collectively machines can have unreachable states
P&SM–8