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
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/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):
label
=
"
init
"
init_op
=
self
.
maude
.
operators
([
label
],
[],
"
State
"
,
[])
# tick
tick
=
"
tickOk
"
# clocks
clocks
=
[
clock
for
clock
in
model
.
clocks
]
clocks_str
=
f
"
(
{
'
,
'
.
join
(
clocks
)
}
)
"
if
len
(
clocks
)
else
"
empty
"
# params
params
=
[
param
for
param
in
model
.
parameters
]
params_str
=
f
"
(
{
'
,
'
.
join
(
params
)
}
)
"
if
len
(
params
)
else
"
empty
"
# variables
# TODO: add variables to the imitator parser (antlr)
variables
=
[]
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
ops idle sugar coffee cdone : -> Location [ctor] .
ops press cup sleep coffee : -> Action [ctor] .
ops machine : -> Agent [ctor] .
ops x y
: -> Clock [ctor] .
ops p1 p2 p3
: -> Parameter [ctor] .
ops x y : -> Clock [ctor] .
ops p1 p2 p3 : -> Parameter [ctor] .
op Coffee : -> Automaton .
eq Coffee = < coffee @ idle | (@ idle inv True :
(when True local bstart do { x := 0 ; y := 0 } goto addsugar)),
(@ addsugar inv y <= p2 :
(when p1 <= x local bsugar do { x := 0 } goto addsugar ;
when y = p2 local cup goto preparing)),
(@ preparing inv y <= p3 :
(when y = p3 local coffee do { x := 0 } goto done)) ,
(@ done inv x <= c(10) :
(when x = c(10) local sleep goto idle ;
when True local bstart do { x := 0 ; y := 0 } goto addsugar))
op Machine : -> Automaton .
eq Machine = < machine @ idle |
(@ idle inv True :
(when True local press do { x := 0 ; y := 0 } goto sugar)),
(@ sugar inv y <= p2 :
(when p1 <= x local press do { x := 0 } goto sugar ;
when y = p2 local cup goto coffee)),
(@ coffee inv y <= p3 :
(when y = p3 local coffee do { x := 0 } goto cdone)) ,
(@ cdone inv x <= c(10) :
(when x = c(10) local sleep goto idle ;
when True local press do { x := 0 ; y := 0 } goto sugar))
> .
op init : -> State .
...
...
@@ -40,4 +41,4 @@ mod MODEL is
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