Commit 4559f49
Range count quantifier (#438)
* quantifier fixes
* feat: added range count quantifier
* feat: updates
* feat: added is valid
* refactor: remove dead requires_sum/requires_filter_indices, use range_based()
After the unify-quantifier-helpers work, count/sum_map/range_count are
direct scalar helpers — none wrap their result with $0_vec_$sum anymore.
The `qt.requires_sum()` gates in mono_analysis and verification_analysis
were pushing `prover_vec_sum_qid` as a dead dependency.
- Remove QuantifierType::requires_sum() and requires_filter_indices()
(both had no remaining callers after the refactor).
- Drop the now-dead push_todo_fun / mark_inlined calls for the sum helper
in mono_analysis.rs and verification_analysis.rs.
- Replace `matches!(info.qht, RangeMap | RangeCount)` with the existing
`info.qht.range_based()` method in lib.rs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add range_sum_map quantifier helper
Mirrors range_count as the sum-over-integer-range counterpart, and
completes the range-based helper family:
| Helper | Vector-valued | Scalar-valued |
|-----------------|---------------|---------------|
| Over a vector | map, filter, | count, sum_map,
| | find_indices | find_index |
| Over a range | range_map | range_count,
| | | range_sum_map (NEW)
Move API: `range_sum_map!<U>(start, end, |i| f(i)): Integer` — sums
FN(i) for i in [start, end). Typed as Integer for overflow safety.
Boogie axioms (scalar helper parallel to sum_map, range-based like
range_count): empty, left-step, right-step, split (compound trigger),
and bounding gated on `result_is_unsigned` (FN's Move return type).
No singleton — derivable from left-step + empty and keeps matching
pressure low.
Tests: range_sum_map.ok (concrete), range_sum_map.fail, and
range_sum_map_split.ok (symbolic n/k forces the split axiom to fire).
404 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: fill coverage gaps for range_count and range_sum_map
Targeted tests that exercise axiom shapes previously only covered for
the vector-based helpers:
- range_count_split.ok — symbolic n/k forcing the split axiom to fire
(two-way and three-way partitions).
- range_count_loop.ok — loop iterating [0, n) with invariant over the
processed prefix, exercising left-step.
- range_sum_map_bounding.ok — symbolic a/b nested in [0, n], exercises
the unsigned-return bounding axiom gate.
- range_sum_map_loop.ok — loop with 0/1-contribution FN (odd_to_int)
mirroring sum_map_loop, exercises left-step without overflow concerns.
408 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Andrei Stefanescu <andrei@stefanescu.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ee156b0 commit 4559f49
File tree
28 files changed
+663
-39
lines changed- crates
- move-model/src
- move-prover-boogie-backend/src/boogie_backend
- prelude
- move-stackless-bytecode/src
- sui-prover/tests
- inputs/quantifiers
- snapshots/quantifiers
- packages/prover/sources
28 files changed
+663
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1633 | 1633 | | |
1634 | 1634 | | |
1635 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1636 | 1640 | | |
1637 | 1641 | | |
1638 | 1642 | | |
| |||
2122 | 2126 | | |
2123 | 2127 | | |
2124 | 2128 | | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
2125 | 2157 | | |
2126 | 2158 | | |
2127 | 2159 | | |
| |||
3557 | 3589 | | |
3558 | 3590 | | |
3559 | 3591 | | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
3560 | 3596 | | |
3561 | 3597 | | |
3562 | 3598 | | |
| |||
3802 | 3838 | | |
3803 | 3839 | | |
3804 | 3840 | | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
3805 | 3845 | | |
3806 | 3846 | | |
3807 | 3847 | | |
| |||
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
152 | | - | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | | - | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
3483 | 3486 | | |
3484 | 3487 | | |
3485 | 3488 | | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
3486 | 3513 | | |
3487 | 3514 | | |
3488 | 3515 | | |
| |||
Lines changed: 12 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
| 572 | + | |
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
633 | 632 | | |
634 | 633 | | |
635 | 634 | | |
| |||
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
1431 | 1494 | | |
1432 | 1495 | | |
1433 | 1496 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
| |||
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| 163 | + | |
| 164 | + | |
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
166 | 181 | | |
167 | 182 | | |
168 | 183 | | |
| |||
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
| 207 | + | |
| 208 | + | |
192 | 209 | | |
193 | 210 | | |
194 | 211 | | |
| |||
200 | 217 | | |
201 | 218 | | |
202 | 219 | | |
| 220 | + | |
| 221 | + | |
203 | 222 | | |
204 | 223 | | |
205 | 224 | | |
| |||
215 | 234 | | |
216 | 235 | | |
217 | 236 | | |
| 237 | + | |
| 238 | + | |
218 | 239 | | |
219 | 240 | | |
220 | 241 | | |
| |||
228 | 249 | | |
229 | 250 | | |
230 | 251 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 252 | | |
246 | 253 | | |
247 | 254 | | |
| |||
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
| 270 | + | |
| 271 | + | |
263 | 272 | | |
264 | 273 | | |
265 | 274 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
583 | 582 | | |
584 | 583 | | |
585 | 584 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | 585 | | |
595 | 586 | | |
596 | 587 | | |
| |||
0 commit comments