Skip to content

Commit f7e0209

Browse files
committed
Update deli README to reflect bounded model and current properties
1 parent f590f02 commit f7e0209

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

specifications/deli/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Deli
22

3-
A TLA⁺ specification of a simple deli ordering system with a ticket-queue model.
3+
A TLA⁺ specification of a simple deli ordering system with a bounded ticket-queue model.
44

5-
The spec models a single worker serving customers in queue order. Customers arrive, receive a ticket number, join an order queue, get assigned to the worker, receive service, and the system resets to serve the next customer. The system cycles through four states: Idle → TakingOrder → PreparingOrder → Serving → ReturnToIdle.
5+
The spec models customers arriving and being served sequentially. Customers arrive (bounded by `MaxArrivals`), receive a ticket number, join an order queue, get assigned to a worker, receive service, and the system resets to serve the next customer. The system cycles through states: Idle → TakingOrder → PreparingOrder → Serving → ReturnToIdle.
66

7-
## Key Features
7+
## Design
88

99
- **Ticket-based ordering**: Customers get monotonically increasing ticket numbers as they arrive
1010
- **Queue discipline**: Customers are served in FIFO order from the queue
11-
- **Worker assignment**: A dedicated worker is assigned in the PrepareOrder phase
12-
- **State machine with return cycle**: Unlike simpler queue models, the system explicitly returns to Idle, enabling liveness properties
11+
- **Bounded arrivals**: The `MaxArrivals` constant limits customer arrivals for tractable model checking
12+
- **State machine with return cycle**: The system explicitly cycles back to Idle after each service, preventing deadlock and allowing new orders
1313

14-
## Properties Checked
14+
## Properties Verified
1515

16-
The specification includes three safety invariants and one liveness property:
16+
The specification includes three safety invariants, all verified by TLC:
1717

1818
1. **TypeOK**: State variables maintain correct types throughout execution
1919
2. **ValidStates**: The system never enters an undefined state
20-
3. **MutualExclusion**: At most one customer-worker pair is in the Serving state at any time
21-
4. **EventuallyIdle**: The system eventually returns to the Idle state (progress/fairness)
20+
3. **MutualExclusion**: At most one customer is being served at any time; idle workers cannot be assigned
2221

23-
The `.tla` file includes formal THEOREM declarations for each property, making the spec suitable for TLC model checking and serving as a test case for the TLC toolchain.
22+
The `.tla` file includes formal THEOREM declarations for each property. With `MaxArrivals = 2` and `Processes = {p1, p2, p3}`, the model contains **30 distinct states** and completes exhaustive model checking in under 1 second.

0 commit comments

Comments
 (0)