Commit 064e019
authored
fix(core): isolate path conditions at the procedure boundary (#1391)
Fixes #1390.
**Problem:** `Program.eval` threads one `Env` through all procedures. A
structured `exit` out of a labeled block doesn't pop its path-condition
frames (`.block` exit pops `exprEnv.state`, not `pathConditions`; the
exiting path bypasses `Env.merge`), so a procedure's
preconditions/assumptions leak into later procedures. A contradictory
leaked set then makes the next procedure prove false obligations
vacuously — silent unsound pass. Laurel lowers non-final `return` to
`exit "$body"`, so ordinary early-return code hits it.
**Fix:** reset `pathConditions` to the pre-procedure state in the
`.proc` fold (deferred obligations and fresh names carry forward). A
`.block`-level reset was rejected — breaks fall-through.
**Test:** `ProcedurePathConditionIsolation` — unsatisfiable-precondition
`first` + structured `exit`, `second`'s `assert false` must fail. Red
without the fix, green with it; full `StrataTest` green (539). Control
matrix + scope in #1390.1 parent a6e0cee commit 064e019
2 files changed
Lines changed: 63 additions & 0 deletions
File tree
- StrataTest/Languages/Core/Tests
- Strata/Languages/Core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments