Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pta2maude
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
real-time maude
pta2maude
Commits
a8e7f8dc
Commit
a8e7f8dc
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove _ in action labels
parent
1111266f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pta2maude/src/ImitatorVisitor.py
+5
-3
5 additions, 3 deletions
pta2maude/src/ImitatorVisitor.py
pta2maude/tests/examples/fischer-intrpr.maude
+21
-21
21 additions, 21 deletions
pta2maude/tests/examples/fischer-intrpr.maude
with
26 additions
and
24 deletions
pta2maude/src/ImitatorVisitor.py
+
5
−
3
View file @
a8e7f8dc
...
@@ -70,6 +70,7 @@ class MyVisitor(ImitatorVisitor):
...
@@ -70,6 +70,7 @@ class MyVisitor(ImitatorVisitor):
parsed_synclabs
=
ctx
.
synclabs
()
parsed_synclabs
=
ctx
.
synclabs
()
if
parsed_synclabs
is
not
None
and
parsed_synclabs
.
name_list
()
is
not
None
:
if
parsed_synclabs
is
not
None
and
parsed_synclabs
.
name_list
()
is
not
None
:
synclabs
=
parsed_synclabs
.
name_list
().
getText
().
split
(
"
,
"
)
synclabs
=
parsed_synclabs
.
name_list
().
getText
().
split
(
"
,
"
)
synclabs
=
[
self
.
_sanitize_location_name
(
s
)
for
s
in
synclabs
]
automaton
=
Automaton
(
self
.
_sanitize_location_name
(
ctx
.
NAME
()),
synclabs
)
automaton
=
Automaton
(
self
.
_sanitize_location_name
(
ctx
.
NAME
()),
synclabs
)
locations
=
ctx
.
locations
()
locations
=
ctx
.
locations
()
...
@@ -109,15 +110,16 @@ class MyVisitor(ImitatorVisitor):
...
@@ -109,15 +110,16 @@ class MyVisitor(ImitatorVisitor):
update
=
[]
update
=
[]
sync
=
None
sync
=
None
if
action
is
not
None
:
if
action
is
not
None
:
sync
=
action
.
sync_label
()
if
action
.
updates
()
is
not
None
:
if
action
.
updates
()
is
not
None
:
update_list
=
action
.
updates
().
update_list
()
update_list
=
action
.
updates
().
update_list
()
if
update_list
is
not
None
:
if
update_list
is
not
None
:
update
=
update_list
.
getText
().
split
(
"
,
"
)
update
=
update_list
.
getText
().
split
(
"
,
"
)
sync
=
action
.
sync_label
()
if
sync
is
not
None
:
if
sync
is
not
None
:
sync
=
str
(
action
.
sync_label
().
NAME
())
sync
=
self
.
_sanitize_location_name
(
str
(
action
.
sync_label
().
NAME
())
)
# add reset if transition points to an urgent location
# add reset if transition points to an urgent location
if
target
in
self
.
fresh_clocks
:
if
target
in
self
.
fresh_clocks
:
...
...
This diff is collapsed.
Click to expand it.
pta2maude/tests/examples/fischer-intrpr.maude
+
21
−
21
View file @
a8e7f8dc
...
@@ -4,7 +4,7 @@ mod MODEL is
...
@@ -4,7 +4,7 @@ mod MODEL is
extending ANALYSIS .
extending ANALYSIS .
ops active1 active2 check1 check2 cs1 cs2 idle1 idle2 locaccess1 locaccess2 obs1 obs2 obsviolation obswaiting : -> Location [ctor] .
ops active1 active2 check1 check2 cs1 cs2 idle1 idle2 locaccess1 locaccess2 obs1 obs2 obsviolation obswaiting : -> Location [ctor] .
ops access
_
1 access
_
2 enter
_
1 enter
_
2 exit
_
1 exit
_
2 no
_
access
_
1 no
_
access
_
2 try
_
1 try
_
2 update
_
1 update
_
2 : -> Action [ctor] .
ops access1 access2 enter1 enter2 exit1 exit2 noaccess1 noaccess2 try1 try2 update1 update2 : -> Action [ctor] .
ops observer proc1 proc2 : -> Agent [ctor] .
ops observer proc1 proc2 : -> Agent [ctor] .
ops x1 x2 : -> Clock [ctor] .
ops x1 x2 : -> Clock [ctor] .
op turn : -> DVariable [ctor] .
op turn : -> DVariable [ctor] .
...
@@ -13,46 +13,46 @@ mod MODEL is
...
@@ -13,46 +13,46 @@ mod MODEL is
op Proc1 : -> Automaton .
op Proc1 : -> Automaton .
eq Proc1 = < proc1 |
eq Proc1 = < proc1 |
(@ idle1 inv true :
(@ idle1 inv true :
(when (turn = -1) local try
_
1 do { x1 := 0 } goto active1)),
(when (turn = -1) local try1 do { x1 := 0 } goto active1)),
(@ active1 inv (x1 <= delta) :
(@ active1 inv (x1 <= delta) :
(when true local update
_
1 do { turn := 1 ; x1 := 0 } goto check1)),
(when true local update1 do { turn := 1 ; x1 := 0 } goto check1)),
(@ check1 inv true :
(@ check1 inv true :
(when ((x1 >= gamma) and (turn = 1)) local access
_
1 do { nothing } goto locaccess1 ,
(when ((x1 >= gamma) and (turn = 1)) local access1 do { nothing } goto locaccess1 ,
when ((x1 >= gamma) and (turn < 1)) local no
_
access
_
1 do { nothing } goto idle1 ,
when ((x1 >= gamma) and (turn < 1)) local noaccess1 do { nothing } goto idle1 ,
when ((x1 >= gamma) and (turn > 1)) local no
_
access
_
1 do { nothing } goto idle1)),
when ((x1 >= gamma) and (turn > 1)) local noaccess1 do { nothing } goto idle1)),
(@ locaccess1 inv true :
(@ locaccess1 inv true :
(when true sync enter
_
1 do { nothing } goto cs1)),
(when true sync enter1 do { nothing } goto cs1)),
(@ cs1 inv true :
(@ cs1 inv true :
(when true sync exit
_
1 do { turn := -1 } goto idle1)) >
(when true sync exit1 do { turn := -1 } goto idle1)) >
.
.
op Proc2 : -> Automaton .
op Proc2 : -> Automaton .
eq Proc2 = < proc2 |
eq Proc2 = < proc2 |
(@ idle2 inv true :
(@ idle2 inv true :
(when (turn = -1) local try
_
2 do { x2 := 0 } goto active2)),
(when (turn = -1) local try2 do { x2 := 0 } goto active2)),
(@ active2 inv (x2 <= delta) :
(@ active2 inv (x2 <= delta) :
(when true local update
_
2 do { turn := 2 ; x2 := 0 } goto check2)),
(when true local update2 do { turn := 2 ; x2 := 0 } goto check2)),
(@ check2 inv true :
(@ check2 inv true :
(when ((x2 >= gamma) and (turn = 2)) local access
_
2 do { nothing } goto locaccess2 ,
(when ((x2 >= gamma) and (turn = 2)) local access2 do { nothing } goto locaccess2 ,
when ((x2 >= gamma) and (turn < 2)) local no
_
access
_
2 do { nothing } goto idle2 ,
when ((x2 >= gamma) and (turn < 2)) local noaccess2 do { nothing } goto idle2 ,
when ((x2 >= gamma) and (turn > 2)) local no
_
access
_
2 do { nothing } goto idle2)),
when ((x2 >= gamma) and (turn > 2)) local noaccess2 do { nothing } goto idle2)),
(@ locaccess2 inv true :
(@ locaccess2 inv true :
(when true sync enter
_
2 do { nothing } goto cs2)),
(when true sync enter2 do { nothing } goto cs2)),
(@ cs2 inv true :
(@ cs2 inv true :
(when true sync exit
_
2 do { turn := -1 } goto idle2)) >
(when true sync exit2 do { turn := -1 } goto idle2)) >
.
.
op Observer : -> Automaton .
op Observer : -> Automaton .
eq Observer = < observer |
eq Observer = < observer |
(@ obswaiting inv true :
(@ obswaiting inv true :
(when true sync enter
_
1 do { nothing } goto obs1 ,
(when true sync enter1 do { nothing } goto obs1 ,
when true sync enter
_
2 do { nothing } goto obs2)),
when true sync enter2 do { nothing } goto obs2)),
(@ obs1 inv true :
(@ obs1 inv true :
(when true sync exit
_
1 do { nothing } goto obswaiting ,
(when true sync exit1 do { nothing } goto obswaiting ,
when true sync enter
_
2 do { nothing } goto obsviolation)),
when true sync enter2 do { nothing } goto obsviolation)),
(@ obs2 inv true :
(@ obs2 inv true :
(when true sync exit
_
2 do { nothing } goto obswaiting ,
(when true sync exit2 do { nothing } goto obswaiting ,
when true sync enter
_
1 do { nothing } goto obsviolation)),
when true sync enter1 do { nothing } goto obsviolation)),
(@ obsviolation inv true : empty) >
(@ obsviolation inv true : empty) >
.
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment