-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·79 lines (73 loc) · 2.34 KB
/
build.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/zsh
git clean -Xf
if [[ "$(uname)" == "Darwin" ]]; then
platform="Mac"
sedi="-i.bak"
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
platform="Linux"
sedi="-i"
fi
if [[ "$2" == "default" ]]
then
power="empty"
preds="relEqualsMessage,relEqualsProcess,relKeyinKey,relHappensBefore,relNonceInNonce"
elif [[ "$2" == "all" ]]
then
preds="relEqualsMessage,relEqualsProcess,relKeyinKey,relHappensBefore,aManInTheMiddle,bManInTheMiddle,relReplay,relNonceInNonce"
if [[ "$1" == "sym" ]]
then
power="relReplay"
elif [[ "$1" == "pub" ]]
then
power="aManInTheMiddle,bManInTheMiddle"
fi
elif [[ "$2" == "default2" ]]
then
power=""
else
echo "Predicate set $2 not found"
exit 1
fi
scope="$3"
redundancy="T"
if [[ "$1" == "sym" ]]
then
prop="EventuallyAliceAndBobCommunicateWithEachOther"
file="needhamSchroederSymmetric.als"
args=($power $file $prop $scope $preds $redundancy)
elif [[ "$1" == "pub" ]]
then
prop="EventuallyAliceAndBobCommunicateWithEachOther"
file="needhamSchroederPublicKey.als"
args=($power $file $prop $scope $preds $redundancy)
elif [[ "$1" == "pc" ]]
then
prop="NeverSecretMessageEveCanSee"
file="publicChannel.als"
args=("empty" $file $prop $scope "relIsTrue,relEqualsMessage,relEqualsProcess,relEqualsKey" $redundancy)
elif [[ "$1" == "tcp" ]]
then
if [[ "$2" == "all" ]]
then
preds="empty"
power="AReadAttacker,BReadAttacker,relEqualsMessage,relAInState,relBInState,relNotEqualsTime"
elif [[ "$2" == "default" ]]
then
preds="empty"
power="AReadAttacker,BReadAttacker,relEqualsMessage,relAInState,relNotEqualsTime"
elif [[ "$2" == "default2" ]]
then
preds="empty"
power="AReadAttacker,BReadAttacker,relEqualsMessage,relAInState,relNotEqualsTime,attackerSentSyn,attackerSentSynAck"
fi
prop="NoHalfClosedConnectionEst"
file="tcp.als"
args=($preds $file $prop $scope $power $redundancy)
else
echo "Experiment name $1 not found"
exit 1
fi
echo "s/check Check${prop}.*/check Check${prop} for ${scope}/g" "./alloy/$file"
sed $sedi "s/check Check${prop}.*/check Check${prop} for ${scope}/g" "./alloy/$file"
javac -cp "./alloy/allAlloyChanges.jar:./src/" ./src/ClassifyCounterexamples.java
java -Xmx6g -cp "./alloy/allAlloyChanges.jar:./src/" ClassifyCounterexamples $args