FSM-to-Program Machine
As shown by the arguments of the Action and NextState functions above,
(1) In a Moore model, actions depend on the state only, not the event causing a state transition.
(2) In a Mealy model, actions depend on both the state and the event causing a state transition.
We assume the transition is instantaneous, so the action occurs at the (simultaneous) time
of exit from original state and entry to the destination state.
(3) The NextState function depends on both the current state AND the event in both models.