next up previous
Next: C. Use a proof Up: Proving an Invariant Previous: A. Use induction over

B. Show that your state space predicate implies the invariant.

A second technique is that if you're lucky the predicate that you've used to define your state space is stronger than the invariant you're trying to prove. So regardless of whether a state is reachable or not, you can prove the invariant holds:

tex2html_wrap_inline380

where P is the predicate describing your set of states. If it's true of every state, then certainly it's true of every reachable state.

For example, recall in the Counter example, the predicate P is simply tex2html_wrap_inline360 . Hence we can trivially show the invariant property holds:

tex2html_wrap_inline388



Norman Papernick
Mon Mar 18 14:28:12 EST 1996