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
0002dc4e
Commit
0002dc4e
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
wip: add init equations
parent
083f736b
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
+35
-0
35 additions, 0 deletions
pta2maude/src/Parser.py
pta2maude/tests/examples/coffee-intrpr.maude
+2
-1
2 additions, 1 deletion
pta2maude/tests/examples/coffee-intrpr.maude
with
37 additions
and
1 deletion
pta2maude/src/Parser.py
+
35
−
0
View file @
0002dc4e
...
...
@@ -881,6 +881,37 @@ class InterpreterParser(Parser):
--- -------------------------
"""
def
_get_init_eq
(
self
,
model
:
Model
)
->
str
:
label
=
"
init
"
init_op
=
self
.
maude
.
operators
([
label
],
[],
"
State
"
,
[])
tick
=
"
tickOk
"
clocks
=
[
clock
for
clock
in
model
.
clocks
]
clocks_str
=
f
"
(
{
'
,
'
.
join
(
clocks
)
}
)
"
if
len
(
clocks
)
else
"
empty
"
params
=
[
param
for
param
in
model
.
parameters
]
params_str
=
f
"
(
{
'
,
'
.
join
(
params
)
}
)
"
if
len
(
params
)
else
"
empty
"
variables
=
[]
vars_str
=
f
"
(
{
'
,
'
.
join
(
variables
)
}
)
"
if
len
(
variables
)
else
"
empty
"
tab
=
"
"
*
22
config
=
f
"
\n
{
tab
}
"
.
join
(
[
f
"
tick:
{
tick
}
"
,
f
"
clocks:
{
clocks_str
}
"
,
f
"
parameters:
{
params_str
}
"
,
f
"
dvariables:
{
vars_str
}
"
,
]
)
agents
=
"
"
.
join
([
automaton
.
name
for
automaton
in
model
.
automata
])
init_eq_str
=
f
"
eq
{
label
}
= {{
{
agents
}
}}
\n
{
tab
}
<
{
config
}
>
\n
{
tab
}
.
"
eq
=
f
"""
{
init_op
}
{
init_eq_str
}
"""
return
eq
def
_get_search_cmd
(
self
)
->
str
:
return
""
...
...
@@ -890,6 +921,8 @@ class InterpreterParser(Parser):
preamble
=
self
.
_get_preamble
(
model
)
variables
=
self
.
_get_variables
()
init
=
self
.
_get_init_eq
(
model
)
rules
=
""
search_cmd
=
self
.
_get_search_cmd
()
...
...
@@ -901,6 +934,8 @@ class InterpreterParser(Parser):
{
preamble
}
{
rules
}
{
init
}
{
variables
}
endm
...
...
This diff is collapsed.
Click to expand it.
pta2maude/tests/examples/coffee-intrpr.maude
+
2
−
1
View file @
0002dc4e
...
...
@@ -23,7 +23,7 @@ mod MODEL is
> .
op init : -> State .
eq init = {
Coffe
e }
eq init = {
machin
e }
< tick: tickOk
clocks: (x : 0/1, y : 0/1)
parameters: (p1 : 1, p2 : 1, p3 : 1)
...
...
@@ -37,6 +37,7 @@ mod MODEL is
var DVARS : SetAssignment .
var SSTDEF : SStateDef .
--- -------------------------
endm
search [1] init =>* { < coffee @ 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