Quiz. Proving validity with invariants [004d]

Let's consider the statement \(W\):


  while x < n do 
    x = x + 1

Answer the following questions:

  1. Prove the validity of \[ \vdash \{x \leq n\}\ W\ \{x \geq n\} \] using the loop invariant \(I = x \leq n\)
  2. Would \(\top \) also have worked as a loop invariant?
  3. If we changed the post condition to \(x = n\), what would that have changed?