Enforce model-checking depth bounds at the frontier - #13
Conversation
|
Review findings — the frontier fix itself is correct in both drivers (traced: sequential Confirmed regression: depth bound 0 skips all checks on initial states (reproduced)In Reproduced failure scenario (both sequential and parallel drivers, on this PR's head): a transition system whose initial state violates an invariant, searched via Reachability: the The underlying off-by-one asymmetry: for every bound Suggested fix: base suppression on the state's actual depth rather than the completed-frontier count — i.e., suppress checks only when the state's depth Minor pre-existing note (unchanged by this PR, no action needed): |
Summary
Root cause
The checker evaluated violations before honoring
reachedDepthBound, and sequential search passed stalecompletedDepthstate into that decision. Consequently a state beyond the requested BFS frontier could be reported as a counterexample. The termination result could also expose the overshot internal frontier instead of the configured bound.Minimum viable reproduction
Save this as
DepthBound.lean. The first bad state is exactly four transitions from the initial state, while the requested bound is three:Run:
$ lake env lean DepthBound.leanObserved before this PR: the sequential search reports the bad state at depth 4 despite the configured bound of 3 (and the analogous parallel search does the same). Some bounded-safe results report the overshot internal depth.
Expected: the result is
.noViolationFound ... (.reachedDepthBound 3). Raising the bound to 4 must instead include and report the depth-4 safety violation. Sequential and parallel modes must agree.Regression test
VeilTest/Regression/ModelCheckDepthBound.leanbuilds this independent linear transition system and runsfindReachabledirectly. It asserts, in both sequential and forced-parallel modes, that bound 3 excludes the depth-4 violation and reports exactly 3, while bound 4 includes the violation with a four-step trace. It also checks that bound 0 still reports an invariant violation in the initial state with a zero-step trace. The test throws anIO.userErroron any other result, so the file cannot build if either boundary regresses.Verification
R2_MaxDepthBoundary.leanlake build VeilTest.Regression.ModelCheckDepthBoundlake build VeilTest(1502 jobs)git diff --check