[FMFP] Notes for examp prep

This commit is contained in:
2026-07-17 10:59:54 +02:00
parent 6967a1eb4c
commit 452e259792
5 changed files with 53 additions and 4 deletions
@@ -7,5 +7,9 @@ Contrary to those however, we have pre- and postconditions, which we typically n
This typically involves finding a loop invariant that holds before and after each iteration of the loop.
This invariant should mention every variable used in the loop.
Any other variable should also be mentioned in it. The loop \textit{variant} may also be added for proving termination.
A typical for-loop loop variant would be \texttt{n - x}, as the next value of the loop variant has to be lower than the previous one.
A typical for-loop loop variant would be \texttt{n - x = Z}, as the next value of the loop variant has to be lower than the previous one.
Of course, if \texttt{x} is decreasing, it itself can become the variant, as it fulfils the condition.
Proof outlines work by providing post and pre-condition for each sub-statement in a statement.
If we need to rewrite a statement (e.g. before the first loop body to change to our loop invariant from the overall precondition),
we use the $\models$ symbol.