-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·42 lines (40 loc) · 1.57 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# specify the path to the slugs binary
slugs="/home/tung/Desktop/slugs/src/slugs"
# specify the path to the compiler for the structured slugs parser
parse_slugs="/home/tung/Desktop/slugs/tools/StructuredSlugsParser/compiler.py"
# define current directory
dir=$(pwd)
# define contract input directory
input=$dir/AG_contract
input2=$dir/contracts/AG_contract
if [ $# -gt 0 ]; then
if [ $1 = "check" ]; then
python3 $dir/contracts/medium.py $2 $3
start=$(date +%s%N)
$parse_slugs $input2.structuredslugs > $input2.slugsin
$slugs --explicitStrategy $input2.slugsin > $input2.strat
end=$(date +%s%N)
runtime=$((end-start))
echo "Computed in $(($runtime/1000000000)) seconds"
elif [ $1 = "syn" ]; then # for check all real rel
start=$(date +%s%N)
$parse_slugs $input2.structuredslugs > $input2.slugsin
$slugs --explicitStrategy $input2.slugsin > $input2.strat
end=$(date +%s%N)
runtime=$((end-start))
echo "Computed in $(($runtime/1000000000)) seconds"
elif [ $1 = "resyn" ]; then # to resynthesize in the event of failure
start=$(date +%s%N)
$parse_slugs $input2.structuredslugs > $input2.slugsin
$slugs --explicitStrategy $input2.slugsin > $input2.strat
end=$(date +%s%N)
runtime=$((end-start))
echo "Computed in $(($runtime/1000000000)) seconds"
python3 $dir/helpers/strategy_parser.py $input2
else
python3 $dir/scenarios/three_islands.py $input2 $1 # run with number of max time steps
fi
else
python3 $dir/scenarios/three_islands.py $input2 100 # run with default of 200 time steps
fi