The Axioms for Program Constructs

Axiom of Assignment:
   { P[ x / y ] }   x = y   { P }
If P is to be true after assignment,
P with x substituted by y
must be true before assignment.

Axiom of Composition:

  If   { P }   S1   { Q }
  and  { Q }   S2   { R }
  then { P }   S1; S2  { R }

Axiom of Condition:

  If   { P and C }      S  { Q }
  and  { P and not C }  T  { Q }
  then { P }
         if C then
            S
         else
            T
         end
       { Q }

Axiom of Iteration:

  If   { P and C }   S   { P }
  then { P }  
         while C do 
             S 
         end  
       { not C and P }
P is loop invariant.