Created
November 12, 2020 21:05
-
-
Save sadraskol/f47a858d340f841ad7096f10419bc30a to your computer and use it in GitHub Desktop.
This file contains 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
-------------------------- MODULE LessDullReservation -------------------------- | |
EXTENDS Naturals, FiniteSets | |
VARIABLE reservations | |
Coaches == { "A", "B" } | |
SeatNumbers == 1..10 | |
Seats == Coaches \X SeatNumbers | |
70PercentTrainOccupation == (70 * Cardinality(Seats)) \div 100 | |
---- | |
Reserve == /\ Cardinality(UNION reservations) < 70PercentTrainOccupation | |
/\ \E singleSeat \in Seats: reservations' = reservations \union {{singleSeat}} | |
---- | |
Init == reservations = {} | |
Next == Reserve | |
---- | |
TypeCheck == reservations \in SUBSET SUBSET Seats | |
AtMost70PercentTrainOccupation == Cardinality(UNION reservations) <= 70PercentTrainOccupation | |
============================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment