Commit 8a7a574
authored
Add
I add a tactic, `wp_if_join`, that allows you to 'join' both branches of
an if-statement into a single assertion by showing that both branches
make said assertion hold.
Given the program below (and assertion `A`)
```
if b { S1; } else { S2; } // no `else` is handled trivially by Goose.
// assertion `A`
S3;
```
By using the tactic `wp_if_join <assertion> [with <ipat>]` (leaving off
the `with` to provide no spatial hypotheses), the goal is split into
three subgoals:
1. Proving that `S1` results in `A` holding,
2. Proving that `S2` results in `A` holding, and
3. Proving the remainder of the program, `S3`, assuming that `A` holds.
---------
Signed-off-by: Cody Rivera <[email protected]>wp_if_join tactic (#532)1 parent 18426cb commit 8a7a574
File tree
2 files changed
+63
-0
lines changed- new
- golang/theory
- proof/github_com/goose_lang/goose/testdata/examples
2 files changed
+63
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
346 | 368 | | |
347 | 369 | | |
348 | 370 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
387 | 428 | | |
388 | 429 | | |
389 | 430 | | |
| |||
0 commit comments