hoare-calculus

Definition

Standard Backward Assignment

The assignment rule describes how an assignment affects the truth of an assertion . It is defined as:

where denotes the substitution of all free occurrences of variable in with the expression .

Mechanics

To prove that holds after the assignment , one must show that would have held if had already been replaced by before the assignment.

This rule is called “backward” because it works from the postcondition to the precondition. It is typically easier to use than the forward assignment rule, as it does not require existential quantifiers to track the “old” value of .

Example

To achieve after , the precondition must be:

Thus: