Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NPTAV2Maude
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
NPTAV2Maude
Commits
9e73c2b5
Commit
9e73c2b5
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
fix benchmarks
parent
c7da6ced
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
benchmarks/benchmarks.sh
+27
-24
27 additions, 24 deletions
benchmarks/benchmarks.sh
benchmarks/models/coffee.folding.maude
+42
-0
42 additions, 0 deletions
benchmarks/models/coffee.folding.maude
benchmarks/models/coffee.no-folding.maude
+42
-0
42 additions, 0 deletions
benchmarks/models/coffee.no-folding.maude
with
111 additions
and
24 deletions
benchmarks/benchmarks.sh
+
27
−
24
View file @
9e73c2b5
...
...
@@ -32,10 +32,13 @@ function run_imitator {
function
parser_files
{
local
model
=
$1
local
mode
=
$2
[[
$mode
=
"folding"
]]
&&
options
=
" --folding"
||
options
=
""
echo
"parsing"
$model
"with mode"
"
$mode
"
"..."
python3
$parser
--input
"
${
model_folder
}
/
${
model
}
.imi"
--output
"
${
model_folder
}
/
${
model
}
.
${
mode
}
.maude
${
options
}
"
if
[[
$mode
=
"folding"
]]
;
then
python3
$parser
--input
"
${
model_folder
}
/
${
model
}
.imi"
--output
"
${
model_folder
}
/
${
model
}
.
${
mode
}
.maude"
--folding
else
python3
$parser
--input
"
${
model_folder
}
/
${
model
}
.imi"
--output
"
${
model_folder
}
/
${
model
}
.
${
mode
}
.maude"
fi
}
# run Maude
...
...
@@ -71,34 +74,34 @@ function run_benchmark {
# 2) get the locations of the full model
locations
=
$(
cat
${
model_folder
}
/
${
model
}
.imi |
grep
"loc .*
\s
*:"
|
cut
-d
:
-f1
|
awk
'{ print $NF }'
)
agents
=
$(
cat
${
model_folder
}
/
${
model
}
.imi |
grep
"^
\s
*automaton"
|
awk
'{ print $2; }'
)
echo
"agents: "
$agents
# imitator files
prop_file
=
"
${
model
}
-EFwitness.imiprop"
model_path
=
"
${
model_folder
}
/
${
model
}
.imi"
a
=
"machine"
for
l
in
$locations
;
do
echo
"reaching
$a
@
$l
"
# 3) run imitator
new_prop_path
=
"
${
output_folder
}
/
${
prop_file
}
.
${
l
}
"
if
[[
!
-f
"
${
new_prop_path
}
.res"
]]
;
then
sed
"s/<replace>/loc[
${
a
}
] =
${
l
}
/"
"
${
model_folder
}
/
${
prop_file
}
"
>
"
${
new_prop_path
}
"
echo
"Running (timeout:
${
timeout
}
)
${
model
}
with
${
new_prop_path
}
"
run_imitator
"
${
model_path
}
"
"
${
new_prop_path
}
"
"
${
timeout
}
"
fi
# 4) run maude
for
mode
in
${
modes
[@]
}
;
do
maude_file
=
"
${
model
}
.
${
mode
}
.maude"
new_file
=
"
${
output_folder
}
/
${
maude_file
}
.
${
l
}
"
if
[[
!
-f
"
${
new_file
}
"
]]
;
then
sed
"s/<replace>/
${
a
}
@
${
l
}
/"
"
${
model_folder
}
/
${
maude_file
}
"
>
"
${
new_file
}
"
echo
"Running Maude (timeout:
${
timeout
}
) with
${
new_file
}
"
run_maude
"
${
new_file
}
"
"
${
timeout
}
"
>
"
${
new_file
}
.res"
for
a
in
$agents
;
do
for
l
in
$locations
;
do
echo
-e
"
\n
reaching
$a
@
$l
"
# 3) run imitator
new_prop_path
=
"
${
output_folder
}
/
${
prop_file
}
.
${
l
}
"
if
[[
!
-f
"
${
new_prop_path
}
.res"
]]
;
then
sed
"s/<replace>/loc[
${
a
}
] =
${
l
}
/"
"
${
model_folder
}
/
${
prop_file
}
"
>
"
${
new_prop_path
}
"
echo
"Running (timeout:
${
timeout
}
)
${
model
}
with
${
new_prop_path
}
"
run_imitator
"
${
model_path
}
"
"
${
new_prop_path
}
"
"
${
timeout
}
"
fi
# 4) run maude
for
mode
in
${
modes
[@]
}
;
do
maude_file
=
"
${
model
}
.
${
mode
}
.maude"
new_file
=
"
${
output_folder
}
/
${
maude_file
}
.
${
l
}
"
if
[[
!
-f
"
${
new_file
}
"
]]
;
then
sed
"s/<replace>/
${
a
}
@
${
l
}
/"
"
${
model_folder
}
/
${
maude_file
}
"
>
"
${
new_file
}
"
echo
"Running Maude (timeout:
${
timeout
}
) with
${
new_file
}
"
run_maude
"
${
new_file
}
"
"
${
timeout
}
"
>
"
${
new_file
}
.res"
fi
done
done
done
...
...
This diff is collapsed.
Click to expand it.
benchmarks/models/coffee.folding.maude
0 → 100644
+
42
−
0
View file @
9e73c2b5
load analysis .
mod MODEL is
extending ANALYSIS .
ops addsugar cdone idle preparingcoffee : -> Location [ctor] .
ops coffee cup press sleep : -> Action [ctor] .
op machine : -> Agent [ctor] .
ops x y : -> Clock [ctor] .
ops p1 p2 p3 : -> Parameter [ctor] .
op Machine : -> Automaton .
eq Machine = < machine |
(@ idle inv true :
(when true local press do { x := 0 ; y := 0 } goto addsugar)),
(@ addsugar inv (y <= p2) :
(when (x >= p1) local press do { x := 0 } goto addsugar ,
when (y = p2) local cup do { nothing } goto preparingcoffee)),
(@ preparingcoffee inv (y <= p3) :
(when (y = p3) local coffee do { x := 0 } goto cdone)),
(@ cdone inv (x <= 10) :
(when true local press do { x := 0 ; y := 0 } goto addsugar ,
when (x = 10) local sleep do { nothing } goto idle)) >
.
op init : -> State .
eq init = { Machine }
< tick: tickOk
locs: (machine @ idle)
clocks: (x : 0, y : 0)
parameters: (p1 : rr(var(p1)), p2 : rr(var(p2)), p3 : rr(var(p3)))
dvariables: empty
constraint: rr(var(p1)) >= 0 and rr(var(p2)) >= 0 and rr(var(p3)) >= 0
n: 1 >
.
endm
red search-folding [ 1 ] in 'MODEL : init => (<replace>) .
quit .
eof
\ No newline at end of file
This diff is collapsed.
Click to expand it.
benchmarks/models/coffee.no-folding.maude
0 → 100644
+
42
−
0
View file @
9e73c2b5
load analysis .
mod MODEL is
extending ANALYSIS .
ops addsugar cdone idle preparingcoffee : -> Location [ctor] .
ops coffee cup press sleep : -> Action [ctor] .
op machine : -> Agent [ctor] .
ops x y : -> Clock [ctor] .
ops p1 p2 p3 : -> Parameter [ctor] .
op Machine : -> Automaton .
eq Machine = < machine |
(@ idle inv true :
(when true local press do { x := 0 ; y := 0 } goto addsugar)),
(@ addsugar inv (y <= p2) :
(when (x >= p1) local press do { x := 0 } goto addsugar ,
when (y = p2) local cup do { nothing } goto preparingcoffee)),
(@ preparingcoffee inv (y <= p3) :
(when (y = p3) local coffee do { x := 0 } goto cdone)),
(@ cdone inv (x <= 10) :
(when true local press do { x := 0 ; y := 0 } goto addsugar ,
when (x = 10) local sleep do { nothing } goto idle)) >
.
op init : -> State .
eq init = { Machine }
< tick: tickOk
locs: (machine @ idle)
clocks: (x : 0, y : 0)
parameters: (p1 : rr(var(p1)), p2 : rr(var(p2)), p3 : rr(var(p3)))
dvariables: empty
constraint: rr(var(p1)) >= 0 and rr(var(p2)) >= 0 and rr(var(p3)) >= 0
n: 1 >
.
endm
red synthesis [ 1 ] 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