Ages 16–18 · A Level · Growing
Partial correctness of a nonterminating path
Use the evidence in partial correctness of a nonterminating path to select and justify a valid solution.
Understand the idea
Correctness arguments connect invariants specifications and termination.
Your challenge
A routine is proved to return a sorted permutation whenever it returns, but can loop forever on repeated values. Which claim remains established?
- Total correctness because returned outputs are sorted
- Partial correctness only; total correctness still fails
- No property at all can be proved
How to explore
- Keep the output contract and termination obligation separate.
- Compare each proposed response with the complete observation or trace, rather than with only one familiar word.
- Check the selected response against the complete situation, including a case where a tempting alternative fails.
Open the activity to work with its controls and check your reasoning. Progress stays in this browser.
Keep exploring
DON’T LET THE QUESTION END HEREGive that curiosity
Open the learning space