In the state-transition diagram, a set \(P\) of vertices is stable exactly when all edges from vertices in \(P\) are to vertices in \(P\). Because there are no transitions from inside a stable set to outside the set, there are also no paths from states inside a stable set to states outside the set. There may, however, be paths from outside a stable set into the set.
We prove that a predicate \(P\) is stable for a do-od loop by showing that it is maintained by all its guarded commands:
\( \{P\} \; g \rightarrow c \; \{P\} \)
Let \(safe\) be a set of states where we want to prove that all paths that start in states in \(init\) remain in \(safe\). Our safety proof obligation is to show that every state on every path from every state in \(init\) is in \(safe\).
\( init \subseteq I \subseteq safe \quad \)
Because \(I\) is stable, all paths from \(I\) remain within \(I\). Because \(init\) is a subset of \(I\), all paths from \(init\) remain within \(I\). All paths from \(init\) remain within \(safe\) because \(I\) is in \(safe\).
The initial condition and invariant specify an initial and invariant set of states in the state-transition diagram. All paths from initial states remain forever in the invariant set of set of states.
K. Mani Chandy, Emeritus Simon Ramo Professor, California Institute of Technology