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
21aaad31
Commit
21aaad31
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
replace names in the test example
parent
0002dc4e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pta2maude/src/Parser.py
+8
-0
8 additions, 0 deletions
pta2maude/src/Parser.py
pta2maude/tests/examples/coffee-intrpr.maude
+15
-14
15 additions, 14 deletions
pta2maude/tests/examples/coffee-intrpr.maude
with
23 additions
and
14 deletions
pta2maude/src/Parser.py
+
8
−
0
View file @
21aaad31
...
@@ -885,11 +885,19 @@ class InterpreterParser(Parser):
...
@@ -885,11 +885,19 @@ class InterpreterParser(Parser):
label
=
"
init
"
label
=
"
init
"
init_op
=
self
.
maude
.
operators
([
label
],
[],
"
State
"
,
[])
init_op
=
self
.
maude
.
operators
([
label
],
[],
"
State
"
,
[])
# tick
tick
=
"
tickOk
"
tick
=
"
tickOk
"
# clocks
clocks
=
[
clock
for
clock
in
model
.
clocks
]
clocks
=
[
clock
for
clock
in
model
.
clocks
]
clocks_str
=
f
"
(
{
'
,
'
.
join
(
clocks
)
}
)
"
if
len
(
clocks
)
else
"
empty
"
clocks_str
=
f
"
(
{
'
,
'
.
join
(
clocks
)
}
)
"
if
len
(
clocks
)
else
"
empty
"
# params
params
=
[
param
for
param
in
model
.
parameters
]
params
=
[
param
for
param
in
model
.
parameters
]
params_str
=
f
"
(
{
'
,
'
.
join
(
params
)
}
)
"
if
len
(
params
)
else
"
empty
"
params_str
=
f
"
(
{
'
,
'
.
join
(
params
)
}
)
"
if
len
(
params
)
else
"
empty
"
# variables
# TODO: add variables to the imitator parser (antlr)
variables
=
[]
variables
=
[]
vars_str
=
f
"
(
{
'
,
'
.
join
(
variables
)
}
)
"
if
len
(
variables
)
else
"
empty
"
vars_str
=
f
"
(
{
'
,
'
.
join
(
variables
)
}
)
"
if
len
(
variables
)
else
"
empty
"
...
...
This diff is collapsed.
Click to expand it.
pta2maude/tests/examples/coffee-intrpr.maude
+
15
−
14
View file @
21aaad31
...
@@ -6,20 +6,21 @@ mod MODEL is
...
@@ -6,20 +6,21 @@ mod MODEL is
ops idle sugar coffee cdone : -> Location [ctor] .
ops idle sugar coffee cdone : -> Location [ctor] .
ops press cup sleep coffee : -> Action [ctor] .
ops press cup sleep coffee : -> Action [ctor] .
ops machine : -> Agent [ctor] .
ops machine : -> Agent [ctor] .
ops x y
: -> Clock [ctor] .
ops x y : -> Clock [ctor] .
ops p1 p2 p3
: -> Parameter [ctor] .
ops p1 p2 p3 : -> Parameter [ctor] .
op Coffee : -> Automaton .
op Machine : -> Automaton .
eq Coffee = < coffee @ idle | (@ idle inv True :
eq Machine = < machine @ idle |
(when True local bstart do { x := 0 ; y := 0 } goto addsugar)),
(@ idle inv True :
(@ addsugar inv y <= p2 :
(when True local press do { x := 0 ; y := 0 } goto sugar)),
(when p1 <= x local bsugar do { x := 0 } goto addsugar ;
(@ sugar inv y <= p2 :
when y = p2 local cup goto preparing)),
(when p1 <= x local press do { x := 0 } goto sugar ;
(@ preparing inv y <= p3 :
when y = p2 local cup goto coffee)),
(when y = p3 local coffee do { x := 0 } goto done)) ,
(@ coffee inv y <= p3 :
(@ done inv x <= c(10) :
(when y = p3 local coffee do { x := 0 } goto cdone)) ,
(when x = c(10) local sleep goto idle ;
(@ cdone inv x <= c(10) :
when True local bstart do { x := 0 ; y := 0 } goto addsugar))
(when x = c(10) local sleep goto idle ;
when True local press do { x := 0 ; y := 0 } goto sugar))
> .
> .
op init : -> State .
op init : -> State .
...
@@ -40,4 +41,4 @@ mod MODEL is
...
@@ -40,4 +41,4 @@ mod MODEL is
endm
endm
search [1] init =>* { <
coffe
e @ done | SSTDEF > } < tick: tickNotOk clocks: CLOCKS parameters: PARAMS dvariables: DVARS > .
search [1] init =>* { <
machin
e @
c
done | SSTDEF > } < tick: tickNotOk clocks: CLOCKS parameters: PARAMS dvariables: DVARS > .
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