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
b50a7eb1
Commit
b50a7eb1
authored
Feb 15, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2f44ec56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
Route_tlc_allgraphs.py
Route_tlc_allgraphs.py
+38
-0
No files found.
Route_tlc_allgraphs.py
View file @
b50a7eb1
...
...
@@ -3,6 +3,7 @@
from
__future__
import
print_function
import
sys
from
subprocess
import
check_call
class
Graph
:
...
...
@@ -77,6 +78,42 @@ def genGraphs(N):
Sprevedges
=
Sedges
# verify Route.tla on graph G.
_cfg_base
=
"""
SPECIFICATION
Spec
INVARIANT
TypeOK
Inv
Terminated_then_PathsOK
PROPERTY
Eventually_Terminated
CONSTANT NoRoute = NoRoute
CONSTANT Inf = Inf
"""
def
TLCRoute
(
G
):
cfg
=
_cfg_base
cfg
+=
"
\
n
\
n
\
n
CONSTANTS
\
n
"
for
n
in
G
.
nodes
:
cfg
+=
"%s = %s
\
n
"
%
(
n
,
n
)
cfg
+=
"
\
n
"
cfg
+=
"CONSTANT root = r
\
n
"
cfg
+=
"CONSTANT Nodes = %s
\
n
"
%
setstr
(
G
.
nodes
)
cfg
+=
"CONSTANT Edges = %s
\
n
"
%
setstr
(
G
.
edges
)
writefile
(
"Route.cfg"
,
cfg
)
check_call
(
"./tlc"
,
"Route.tla"
)
def
writefile
(
path
,
data
):
with
open
(
path
,
"w"
)
as
f
:
f
.
write
(
data
)
...
...
@@ -84,6 +121,7 @@ def main():
N
=
int
(
sys
.
argv
[
1
])
for
g
in
genGraphs
(
N
):
print
(
g
)
TLCRoute
(
g
)
...
...
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