Questions: Invariant Generation

3 questions to test your understanding

Score: 0 / 3
Question 1 Multiple Choice

Why is invariant generation considered the bottleneck of automated deductive verification?

ABecause invariants are only needed for recursive functions, which are uncommon
BBecause for straight-line code and conditionals, weakest precondition computation is entirely mechanical, but loops require an invariant that cannot be derived mechanically in general. The invariant must be both preserved by the loop body (inductive) and strong enough to imply the postcondition upon exit
CBecause invariant generation requires exponential time in all cases
DBecause modern SMT solvers cannot check invariant candidates
Question 2 True / False

An invariant candidate I for a loop is valid if it satisfies three conditions: (1) I holds on loop entry, (2) I is preserved by the loop body, and (3) I combined with the exit condition implies the postcondition.

TTrue
FFalse
Question 3 Short Answer

Describe how abstract interpretation can be used to generate loop invariants, and what determines the precision of the generated invariants.

Think about your answer, then reveal below.