Skip to content
Snippets Groups Projects
Commit 77f7b748 authored by Jaime Arias's avatar Jaime Arias
Browse files

fix: benchmarks script

parent 64f2949e
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
imitator="${HOME}/Work/code/imitator/imitator/bin/imitator" imitator="${HOME}/Work/code/imitator/imitator/bin/imitator"
# maude binary # maude binary
maude="maude.darwin64 -no-banner -batch" maude="maude.linux64 -no-banner -batch"
# pta2maude parser # pta2maude parser
BASE_DIR="$(dirname "$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)")" BASE_DIR="$(dirname "$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)")"
...@@ -19,30 +19,30 @@ modes=("collapsing" "no-collapsing") ...@@ -19,30 +19,30 @@ modes=("collapsing" "no-collapsing")
# run imitator # run imitator
function run_imitator { function run_imitator {
model=$1 local model=$1
property=$2 local property=$2
timeout_value=$3 local timeout_value=$3
timeout $timeout_value $imitator "${model}" "${property}" -output-prefix "${property}" timeout $timeout_value $imitator "${model}" "${property}" -output-prefix "${property}"
} }
# run parser pta2maude # run parser pta2maude
function parser_files { function parser_files {
model=$1 local model=$1
mode=$2 local mode=$2
echo "parsing" $name "with mode" "$mode" "..." echo "parsing" $name "with mode" "$mode" "..."
python3 $parser --input "${model_folder}/${model}.imi" --output "${model_folder}/${model}.${mode}.maude" "--${mode}" python3 $parser --input "${model_folder}/${model}.imi" --output "${model_folder}/${model}.${mode}.maude" "--${mode}"
} }
# run Maude # run Maude
function run_maude { function run_maude {
filename=$1 local filename=$1
timeout_value=$2 local timeout_value=$2
timeout "$timeout_value" ${maude} "${filename}" timeout "$timeout_value" ${maude} "${filename}"
} }
# create a folder # create a folder
function create_folder { function create_folder {
path=$1 local path=$1
if [ ! -d "$path" ]; then if [ ! -d "$path" ]; then
mkdir -p "$path"; mkdir -p "$path";
...@@ -50,8 +50,8 @@ function create_folder { ...@@ -50,8 +50,8 @@ function create_folder {
} }
function run_benchmark { function run_benchmark {
model=$1 local model=$1
timeout=$2 local timeout=$2
# create folder to save the output of the model # create folder to save the output of the model
output_folder="logs/${model}" output_folder="logs/${model}"
...@@ -87,6 +87,7 @@ function run_benchmark { ...@@ -87,6 +87,7 @@ function run_benchmark {
# maude files # maude files
maude_file="${model}.${mode}.maude" maude_file="${model}.${mode}.maude"
echo $maude_file
new_file="${output_folder}/${maude_file}.${l}" new_file="${output_folder}/${maude_file}.${l}"
if [[ ! -f "${new_file}" ]]; then if [[ ! -f "${new_file}" ]]; then
......
...@@ -36,7 +36,7 @@ endm ...@@ -36,7 +36,7 @@ endm
load meta-pta . load meta-pta .
red reachability (<replace>, (< idle ; x:Real ; y:Real > < p1:Real ; p2:Real ; p3:Real > | ( x:Real === y:Real and x:Real >= 0/1 and y:Real >= 0/1 and p1:Real >= 0/1 and p2:Real >= 0/1 and p3:Real >= 0/1 ) )) . red reachability (<replace>, ( < idle ; x:Real ; y:Real > < p1:Real ; p2:Real ; p3:Real > | ( x:Real === y:Real and x:Real >= 0/1 and y:Real >= 0/1 and p1:Real >= 0/1 and p2:Real >= 0/1 and p3:Real >= 0/1 ) )) .
quit . quit .
......
...@@ -30,8 +30,8 @@ mod MODEL is ...@@ -30,8 +30,8 @@ mod MODEL is
endm endm
smt-search [1] < idle ; x ; y > < p1 ; p2 ; p3 > =>* smt-search [1] < idle ; x ; y > < p1 ; p2 ; p3 > =>* < <replace> ; x':Real ; y':Real > < p1 ; p2 ; p3 > such that ( x === y and x >= 0/1 and y >= 0/1 and p1 >= 0/1 and p2 >= 0/1 and p3 >= 0/1 ) = true .
< <replace> ; x':Real ; y':Real > < p1 ; p2 ; p3 >
such that ( x === y and x >= 0/1 and y >= 0/1 and p1 >= 0/1 and p2 >= 0/1 and p3 >= 0/1 ) = true . quit .
eof eof
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment