Repository navigation
Require a positive floor count - #245
Merged
Merged
Conversation
lemmy
reviewed
Oct 21, 2026
| Elevator, \* The set of all elevators | ||
| FloorCount \* The number of floors serviced by the elevator system | ||
|
|
||
| ASSUME FloorCountIsInteger == FloorCount \in Int |
Member
There was a problem hiding this comment.
@Qian-Cheng-nju Shouldn't Int be replaced with Nat \ {0}, given that the set of valid floors is defined as Floor == 1 .. FloorCount?
Contributor
Author
There was a problem hiding this comment.
Yes, that makes sense. I'll change it to Nat \ {0} and update the assumption name.
Signed-off-by: Qian-Cheng-nju <Qian-Cheng-nju@users.noreply.github.com>
Qian-Cheng-nju
force-pushed
the
elevator-floor-domain
branch
from
October 23, 2026 09:33
cc8bd43 to
c0d534e
Compare
lemmy
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FloorCountis used inFloor == 1..FloorCount, but its domain is not stated. A Boolean value fails during interval evaluation; zero or negative values leaveFloorempty, soInithas no states when there are people or elevators.Add
ASSUME FloorCountIsPositive == FloorCount \in (Nat \ {0})to require at least one floor. This adds no upper bound and leaves the actions and invariants unchanged.The shipped
ElevatorSafetySmallandElevatorLivenessMediummodels pass with the same 4,122 distinct states. Parameter checks reject zero, negative and Boolean values before initialization, and accept 1, 2 and 1,000,000. Two focused TLAPS lemmas check that moving one floor toward a destination stays inFloor(six obligations,--strict --nofp). SANY passes for both modules.