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
IN
{<<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 {
variables ZZdepth \* node -> depth
= [[n \in Nodes |-> Inf] EXCEPT ![root] = 0],
ZZparent \* node -> parent node
= [[n \in Nodes |-> NoRoute] EXCEPT ![root] = root],
\* msgs[<<n,m>>] is message queue for n->m
msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |-> << >>];
variables
\* msgs[<<n,m>>] is message queue for n->m
\* msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |->
msgs = [q \in Queues |->
IF q[1] = root THEN <<0>> \* start with root sending initial messages
ELSE << >>];
fair process (RT \in Nodes)
variables depth = IF self = root THEN 0 ELSE Inf,
parent = IF self = root THEN root ELSE NoRoute;
variables depth =
IF self = root THEN 0 ELSE Inf,
parent =
IF self = root THEN root ELSE NoRoute;
{
loop: while (TRUE) {
skip;
...
...
@@ -74,23 +77,23 @@ EdgeQQ(e) == LET x == CHOOSE x \in e : TRUE
}
};
********)
\* BEGIN TRANSLATION (chksum(pcal) = "
65933661" /\ chksum(tla) = "ff5ab133
")
VARIABLES
ZZdepth, ZZparent,
msgs, depth, parent
\* BEGIN TRANSLATION (chksum(pcal) = "
c4d34ca9" /\ chksum(tla) = "7195f9d9
")
VARIABLES msgs, depth, parent
vars == <<
ZZdepth, ZZparent,
msgs, depth, parent >>
vars == << msgs, depth, parent >>
ProcSet == (Nodes)
Init == (* Global variables *)
/\
ZZdepth = [[n \in Nodes |-> Inf] EXCEPT ![root] = 0]
/\ ZZparent = [[n \in Nodes |-> NoRoute] EXCEPT ![root] = root]
/\ msgs = [q \in (UNION {EdgeQQ(e) : e \in Edges}) |->
<< >>]
/\
msgs = [q \in Queues |->
IF q[1] = root THEN <<0>>
ELSE
<< >>]
(* Process RT *)
/\ depth = [self \in Nodes |-> IF self = root THEN 0 ELSE Inf]
/\ parent = [self \in Nodes |-> IF self = root THEN root ELSE NoRoute]
RT(self) == /\ TRUE
/\ UNCHANGED <<
ZZdepth, ZZparent,
msgs, depth, parent >>
/\ UNCHANGED << msgs, depth, parent >>
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