Introduction to Mathematically Rigorous Software Development - Proof

Document Sample
Introduction to Mathematically Rigorous Software Development - Proof Powered By Docstoc
					P1:        V  V1 and                             W1:        {I and B} S {I}
           {V1} S {P1} and                               
           P1  P                                            {I} while B do S endwhile {I and not B}
                                                 W2:        {V} init {I} and
           {V} S {P}                                         {I and B} S {I} and
                x                                            (I and not B)  P
A1:        {P        } x:=E {P} completely
                 (E)                                     
                                                             {V} (init, while B do S endwhile) {P}
                    x
A2:        VP
                     (E)                          DC1:       {V1} S {P1} and
                                                            {V2} S {P2}
           {V} x:=E {P}                                  
                                                             {V1 and V2} S {P1 and P2}
IF1:       {V and B} S1 {P} and
           {V and not B} S2 {P}                   DC3:       {V} S {P1} and
                                                            {V} S {P2}
           {V} if B then S1 else S2 endif {P}            
                                                             {V} S {P1 and P2}
IF2:       {V1} S1 {P} and
           {V2} S2 {P}                            SP1:       S changes no variable in B
                                                        
           {(V1 and B) or (V2 and not B)}                    {B} S {B}
           if B then S1 else S2 endif {P}
                                                  SP2:       S changes no variable in B and
S1:        {V} S1 {P1} and                                   {V} S {P}
           {P1} S2 {P}                                   
                                                            {V and B} S {P and B}
           {V} (S1, S2) {P}
                                                  SP3:       S changes no variable in B and
                         xn          x2 x1                   V  V1 and
S2:        V  [[ ... [P     ] ... ]     ]
                           En          E2 E1                 {V1} S {P1} and
                                                            P1  P
           {V} (x1:=E1, x2:=E2, ... xn:=En) {P}          
                                                             {V and B} S {P and B}

                                                             Proof rule card — by Robert L. Baber