We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bcda5a9 + 095413f commit 4bd5c0aCopy full SHA for 4bd5c0a
src/goto-instrument/contracts/doc/user/contracts-history-variables.md
@@ -53,6 +53,13 @@ __CPROVER_loop_entry(*identifier*)
53
54
### Semantics
55
`__CPROVER_loop_entry` takes a snapshot of the variable value right before the **first iteration** of the loop.
56
+Caveat: to create a snapshot of an array, cast the array variable (which is a
57
+pointer per C's type system) to a pointer-to-array, and then dereference.
58
+```c
59
+typedef int array_type[2];
60
+array_type var;
61
+__CPROVER_loop_invariant(__CPROVER_loop_entry(*(array_type*)var)[0] <= 42)
62
+```
63
64
### Example
65
In this example the loop invariant asserts that `x <= 200` is upheld before and after every iteration of the `while` loop:
0 commit comments