Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
KTLA Study
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
KTLA Study
Commits
3229179e
Commit
3229179e
authored
Feb 10, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bd2d1550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
Route.tla
Route.tla
+19
-16
No files found.
Route.tla
View file @
3229179e
...
@@ -54,19 +54,22 @@ EdgeQQ(e) == LET x == CHOOSE x \in e : TRUE
...
@@ -54,19 +54,22 @@ EdgeQQ(e) == LET x == CHOOSE x \in e : TRUE
IN
IN
{<<x,y>>, <<y,x>>}
{<<x,y>>, <<y,x>>}
\* All n->m and m<-n queues
Queues == {e \in Nodes \X Nodes : {e[1],e[2]} \in Edges}
(********
(********
--algorithm Route {
--algorithm Route {
variables ZZdepth \* node -> depth
variables
= [[n \in Nodes |-> Inf] EXCEPT ![root] = 0],
\* msgs[<<n,m>>] is message queue for n->m
ZZparent \* node -> parent node
\* msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |->
= [[n \in Nodes |-> NoRoute] EXCEPT ![root] = root],
msgs = [q \in Queues |->
IF q[1] = root THEN <<0>> \* start with root sending initial messages
\* msgs[<<n,m>>] is message queue for n->m
ELSE << >>];
msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |-> << >>];
fair process (RT \in Nodes)
fair process (RT \in Nodes)
variables depth = IF self = root THEN 0 ELSE Inf,
variables depth =
IF self = root THEN 0 ELSE Inf,
parent = IF self = root THEN root ELSE NoRoute;
parent =
IF self = root THEN root ELSE NoRoute;
{
{
loop: while (TRUE) {
loop: while (TRUE) {
skip;
skip;
...
@@ -74,23 +77,23 @@ EdgeQQ(e) == LET x == CHOOSE x \in e : TRUE
...
@@ -74,23 +77,23 @@ EdgeQQ(e) == LET x == CHOOSE x \in e : TRUE
}
}
};
};
********)
********)
\* BEGIN TRANSLATION (chksum(pcal) = "
65933661" /\ chksum(tla) = "ff5ab133
")
\* BEGIN TRANSLATION (chksum(pcal) = "
c4d34ca9" /\ chksum(tla) = "7195f9d9
")
VARIABLES
ZZdepth, ZZparent,
msgs, depth, parent
VARIABLES msgs, depth, parent
vars == <<
ZZdepth, ZZparent,
msgs, depth, parent >>
vars == << msgs, depth, parent >>
ProcSet == (Nodes)
ProcSet == (Nodes)
Init == (* Global variables *)
Init == (* Global variables *)
/\
ZZdepth = [[n \in Nodes |-> Inf] EXCEPT ![root] = 0]
/\
msgs = [q \in Queues |->
/\ ZZparent = [[n \in Nodes |-> NoRoute] EXCEPT ![root] = root]
IF q[1] = root THEN <<0>>
/\ msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |->
<< >>]
ELSE
<< >>]
(* Process RT *)
(* Process RT *)
/\ depth = [self \in Nodes |-> IF self = root THEN 0 ELSE Inf]
/\ depth = [self \in Nodes |-> IF self = root THEN 0 ELSE Inf]
/\ parent = [self \in Nodes |-> IF self = root THEN root ELSE NoRoute]
/\ parent = [self \in Nodes |-> IF self = root THEN root ELSE NoRoute]
RT(self) == /\ TRUE
RT(self) == /\ TRUE
/\ UNCHANGED <<
ZZdepth, ZZparent,
msgs, depth, parent >>
/\ UNCHANGED << msgs, depth, parent >>
Next == (\E self \in Nodes: RT(self))
Next == (\E self \in Nodes: RT(self))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment