Skip to content

Commit

Permalink
Add a README file
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela committed Jan 27, 2025
1 parent 8ed6389 commit b7605f7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions examples/classic/distributed/ewd426/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EWD426

This folder contains Quint specifications for the three different self-stabilization algorithms proposed by Dijkstra in [EWD426](https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD426.html).
1. A solution with K-state machines [ewd426.qnt](ewd426.qnt)
2. A solution with three-state machines [ewd426_3.qnt](ewd426_3.qnt)
3. A solution with four-state machines [ewd426_4.qnt](ewd426_4.qnt)

Due to the presence of temporal properties and fairness, we need to use TLC to model check these specs. As the integration with TLC is not completed, we provide a script to automate running it for these specific specifications: [check_with_tlc.sh](check_with_tlc.sh).

If you are trying to learn/understand these algorithms, we recommend playing with the Quint REPL. For that, pick one of the files (for example [ewd426.qnt](ewd426.qnt)) and run the following command in the terminal:
``` sh
quint -r ewd426.qnt::ewd426
```

This will open the REPL with the `ewd426` machine loaded. You can now interact with the machine and explore its states and transitions:

``` bluespec
Quint REPL 0.22.4
Type ".exit" to exit, or ".help" for more information
>>> init
true
>>> step
true
>>> show_token(system)
Map(0 -> false, 1 -> true, 2 -> true, 3 -> false, 4 -> true, 5 -> false)
>>> 5.reps(_ => step)
true
>>> show_token(system)
Map(0 -> true, 1 -> false, 2 -> false, 3 -> false, 4 -> false, 5 -> false)
```
4 changes: 2 additions & 2 deletions examples/classic/distributed/ewd426/ewd426_3.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Mahtab Norouzi, Josef Widder, Informal Systems, 2024-2025
*/
module self_stabilization_three_states {
module self_stabilization_three_state {
// Number of nodes in the ring
const N: int

Expand Down Expand Up @@ -90,5 +90,5 @@ module self_stabilization_three_states {
}

module ewd426_3 {
import self_stabilization_three_states(N = 5).*
import self_stabilization_three_state(N = 5).*
}
4 changes: 2 additions & 2 deletions examples/classic/distributed/ewd426/ewd426_4.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Mahtab Norouzi, Josef Widder, Informal Systems, 2024-2025
*/
module self_stabilization_four_states {
module self_stabilization_four_state {
const N: int

val bottom = 0
Expand Down Expand Up @@ -97,5 +97,5 @@ module self_stabilization_four_states {
}

module ewd426_4 {
import self_stabilization_four_states(N = 5).*
import self_stabilization_four_state(N = 5).*
}

0 comments on commit b7605f7

Please sign in to comment.