Skip to content

Commit

Permalink
Move TLC-specific Init to MCInit in MCtcp.tla and rewrite Init to a g…
Browse files Browse the repository at this point in the history
…eneric one (both CLOSED, no TCB, and empty network).

Signed-off-by: Markus Alexander Kuppe <[email protected]>
  • Loading branch information
lemmy committed Apr 6, 2024
1 parent dfdf2ef commit 43b4c93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions specifications/tcp/MCtcp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONSTANTS

CONSTANT
Peers <- peers
Init <- MCInit

SYMMETRY
Symmetry
Expand Down
8 changes: 8 additions & 0 deletions specifications/tcp/MCtcp.tla
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ CONSTANTS A, B
peers == {A, B}
Symmetry == Permutations(peers)

MCInit ==
\* One node starts in the SYN-SENT state, i.e., one node has already received the active open command. The other node
\* is in the listen state, i.e., it has received the passive open command.
\E node \in Peers:
/\ tcb = [p \in Peers |-> TRUE]
/\ connstate = [p \in Peers |-> IF p = node THEN "SYN-SENT" ELSE "LISTEN"]
/\ network = [p \in Peers |-> IF p = node THEN <<>> ELSE << "SYN" >>]

NoRetransmission ==
\A p \in Peers :
\A i \in 1..Len(network[p]) - 1 :
Expand Down
9 changes: 3 additions & 6 deletions specifications/tcp/tcp.tla
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ TypeOK ==
/\ network \in [ Peers -> Seq({"SYN", "SYN,ACK", "ACK", "RST", "FIN"} \cup {"ACKofFIN"}) ]

Init ==
\* One node starts in the SYN-SENT state, i.e., one node has already received the active open command. The other node
\* is in the listen state, i.e., it has received the passive open command.
\E node \in Peers:
/\ tcb = [p \in Peers |-> TRUE]
/\ connstate = [p \in Peers |-> IF p = node THEN "SYN-SENT" ELSE "LISTEN"]
/\ network = [p \in Peers |-> IF p = node THEN <<>> ELSE << "SYN" >>]
/\ tcb = [p \in Peers |-> FALSE]
/\ connstate = [p \in Peers |-> "CLOSED"]
/\ network = [p \in Peers |-> <<>>]

\* Action triggered by user commands:

Expand Down

0 comments on commit 43b4c93

Please sign in to comment.