Commit 81ffa37
fix: three Boogie prelude bugs
1. Unsound axiom in $IndexOfVecMap (native.bpl:588).
The inner forall referenced ReadVec(v, i) (the found index) instead of
ReadVec(v, j). Since the outer body forces v[i].key == k, the inner
!$IsEqual(v[i].key, k) is always false, so the forall becomes
(j < i ==> false), forcing i == 0. For any vec_map whose target key is
at index > 0, the axiom is inconsistent — Z3 derives UNSAT and any
ensures verifies vacuously. Two vec_map tests (get_idx_ok, get_idx_opt_ok)
had ensures that were only true for empty-pre-insert maps, but verified
anyway due to this bug. Tests updated to assert the correct post-insert
index using old_m.length().
2. Mismatched endmacro tag (native.bpl:1548).
bcs_module opens at line 1516, closed with {% endmacro hash_module %}.
Tera ignores the name, but it's a clear copy-paste artifact.
3. Drift in vector-array-intern-theory.bpl.
Sibling vector-array-theory.bpl:117-119 documents that InRangeVec must
stay non-inlined — it guards many quantifiers and needs to be uninterpreted
for triggering. Intern version had it {:inline}, plus inlined the range
check in ContainsVec bypassing InRangeVec entirely. Fixed both.
Not included: the count/sum_map split guard relaxation (proposed as fix #3
in the audit). Empirically caused a matching-pressure regression in
quantifiers_multi_arg_count_loop_ok — the 0 <= start && end <= LenVec(v)
guard was serving as a useful trigger gate. Leaving as-is.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4559f49 commit 81ffa37
File tree
4 files changed
+13
-9
lines changed- crates
- move-prover-boogie-backend/src/boogie_backend/prelude
- sui-prover/tests/inputs/vec_map
4 files changed
+13
-9
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
| 588 | + | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
1548 | | - | |
| 1548 | + | |
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
| |||
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
140 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
0 commit comments