Questions: Weakest Precondition Calculus

4 questions to test your understanding

Score: 0 / 4
Question 1 Multiple Choice

What is wp(x := x + 3, x > 10)?

Ax > 10
Bx > 13
Cx > 7
Dx >= 10
Question 2 True / False

The weakest precondition is 'weakest' in the sense that any other valid precondition for the same command and postcondition must logically imply it.

TTrue
FFalse
Question 3 Short Answer

How does the weakest precondition calculus handle sequential composition? Given wp(C2, Q) = R, what is wp(C1; C2, Q)?

Think about your answer, then reveal below.
Question 4 Short Answer

Why does computing the weakest precondition for a while loop require a loop invariant, breaking the otherwise mechanical nature of the calculus?

Think about your answer, then reveal below.