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
757b57ff
Commit
757b57ff
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
first draft of parser
parent
e826d8ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pta2maude/src/Parser.py
+22
-8
22 additions, 8 deletions
pta2maude/src/Parser.py
pta2maude/tests/examples/coffee-intrpr.maude
+6
-10
6 additions, 10 deletions
pta2maude/tests/examples/coffee-intrpr.maude
with
28 additions
and
18 deletions
pta2maude/src/Parser.py
+
22
−
8
View file @
757b57ff
...
...
@@ -1052,20 +1052,31 @@ class InterpreterParser(Parser):
return
result
def
_get_s
earch
_cmd
(
self
,
nb_traces
:
int
=
None
,
nb_steps
:
int
=
None
)
->
str
:
"""
Return the
search
command for
reachability verification
def
_get_s
ynthesis
_cmd
(
self
,
nb_traces
:
int
=
None
,
nb_steps
:
int
=
None
)
->
str
:
"""
Return the command for
parameter synthesis
Parameters
----------
nb_traces : int
number of traces to be found in the
reachability
analysis
number of traces to be found in the
synthesis
analysis
nb_steps : int
number of steps of the
reachability
analysis
number of steps of the
synthesis
analysis
"""
nb_traces_str
=
""
if
(
nb_traces
is
None
)
else
f
"
[
{
nb_traces
}
]
"
nb_steps_str
=
"
*
"
if
(
nb_steps
is
None
)
else
f
"
{
nb_steps
}
"
params
=
[]
if
nb_traces
is
not
None
:
params
.
append
(
str
(
nb_traces
))
if
nb_steps
is
not
None
:
params
.
append
(
str
(
nb_steps
))
params
=
f
"
[
{
'
;
'
.
join
(
params
)
}
]
"
cmd
=
f
"
search
{
nb_traces_str
}
init =>
{
nb_steps_str
}
{{ <replace> }} < tick: tickNotOk clocks: CLOCKS parameters: PARAMS dvariables: DVARS > .
"
cmd
=
f
"
red synthesis
{
params
}
in
'
MODEL : init => (<replace>) .
"
return
cmd
def
_get_search_cmd
(
self
)
->
str
:
"""
Return the command for reachability analysis
"""
cmd
=
"
red search-folding in
'
MODEL : init => (<replace>) .
"
return
cmd
def
to_maude
(
self
,
model
:
Model
)
->
str
:
...
...
@@ -1100,7 +1111,9 @@ class InterpreterParser(Parser):
equations
=
"
\n
"
.
join
(
[
self
.
_get_automaton
(
a
,
sync_actions
)
for
a
in
model
.
automata
]
)
search_cmd
=
self
.
_get_search_cmd
(
1
)
synthesis_cmd
=
self
.
_get_synthesis_cmd
(
1
)
search_cmd
=
self
.
_get_search_cmd
()
model_str
=
f
"""
\
{
load
}
...
...
@@ -1112,6 +1125,7 @@ class InterpreterParser(Parser):
{
init
}
endm
{
synthesis_cmd
}
{
search_cmd
}
quit .
...
...
This diff is collapsed.
Click to expand it.
pta2maude/tests/examples/coffee-intrpr.maude
+
6
−
10
View file @
757b57ff
...
...
@@ -34,14 +34,10 @@ mod MODEL is
n: 1 >
.
endm
eof
--- Solving EF(loc = cdone) --- one solution
red synthesis [ 1 ] in 'COFFEE : init => (coffee @ cdone) .
red synthesis [ 1 ] in 'COFFEE : init => (coffee @ cdone) such that ( y - x > 0 ) .
--- Solving EF(loc=cdone) with folding
--- This property does not hold
--- This loops
red synthesis [ 1 ; 10 ] in 'COFFEE : init => empty such that ( x - y > 0 ) .
--- This finishes (with answer no)
red search-folding in 'COFFEE : init => empty such that ( x - y > 0 ) .
red synthesis [ 1 ] in 'MODEL : init => (<replace>) .
red search-folding in 'MODEL : init => (<replace>) .
quit .
eof
\ No newline at end of file
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