| author | boehmes |
| Mon, 24 Aug 2009 09:49:50 +0200 | |
| changeset 32397 | 1899b8c47961 |
| parent 32385 | 594890623c46 |
| child 32469 | 1ad7d4fc0954 |
| permissions | -rwxr-xr-x |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
1 |
#!/usr/bin/env bash |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
2 |
# |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
3 |
# Author: Sascha Boehme |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
4 |
# |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
5 |
# DESCRIPTION: testing tool for automated proof tools |
| 32381 | 6 |
|
7 |
||
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
8 |
PRG="$(basename "$0")" |
| 32381 | 9 |
|
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
10 |
function print_action_names() {
|
|
32385
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
11 |
TOOLS="$MIRABELLE_HOME/Tools/mirabelle_*.ML" |
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
12 |
for NAME in $TOOLS |
|
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
13 |
do |
|
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
14 |
echo $NAME | sed 's/.*mirabelle_\(.*\)\.ML/ \1/' |
|
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
15 |
done |
|
32385
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
16 |
} |
|
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
17 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
18 |
function usage() {
|
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
19 |
out="$MIRABELLE_OUTPUT_PATH" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
20 |
timeout="$MIRABELLE_TIMEOUT" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
21 |
echo |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
22 |
echo "Usage: isabelle $PRG [OPTIONS] ACTIONS FILES" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
23 |
echo |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
24 |
echo " Options are:" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
25 |
echo " -L LOGIC parent logic to use (default $ISABELLE_LOGIC)" |
|
32385
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
26 |
echo " -T THEORY parent theory to use (default $MIRABELLE_THEORY)" |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
27 |
echo " -O DIR output directory for test data (default $out)" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
28 |
echo " -v be verbose" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
29 |
echo " -t TIMEOUT timeout for each action in seconds (default $timeout)" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
30 |
echo |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
31 |
echo " Apply the given actions (i.e., automated proof tools)" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
32 |
echo " at all proof steps in the given theory files." |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
33 |
echo |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
34 |
echo " ACTIONS is a colon-separated list of actions, where each action is" |
|
32385
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
35 |
echo " either NAME or NAME[KEY=VALUE,...,KEY=VALUE]. Available actions are:" |
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
36 |
print_action_names |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
37 |
echo |
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
38 |
echo " FILES is a list of theory files, where each file is either NAME.thy" |
|
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
39 |
echo " or NAME.thy[START:END] and START and END are numbers indicating the" |
|
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
40 |
echo " range the given actions are to be applied." |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
41 |
echo |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
42 |
exit 1 |
| 32381 | 43 |
} |
44 |
||
45 |
||
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
46 |
## process command line |
| 32381 | 47 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
48 |
# options |
| 32381 | 49 |
|
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
50 |
while getopts "L:T:O:vt:?" OPT |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
51 |
do |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
52 |
case "$OPT" in |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
53 |
L) |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
54 |
MIRABELLE_LOGIC="$OPTARG" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
55 |
;; |
|
32385
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
56 |
T) |
|
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
57 |
MIRABELLE_THEORY="$OPTARG" |
|
594890623c46
split actions from Mirabelle core (Mirabelle may thus be applied to basic theories in HOL)
boehmes
parents:
32383
diff
changeset
|
58 |
;; |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
59 |
O) |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
60 |
MIRABELLE_OUTPUT_PATH="$OPTARG" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
61 |
;; |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
62 |
v) |
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
63 |
MIRABELLE_VERBOSE="true" |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
64 |
;; |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
65 |
t) |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
66 |
MIRABELLE_TIMEOUT="$OPTARG" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
67 |
;; |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
68 |
\?) |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
69 |
usage |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
70 |
;; |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
71 |
esac |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
72 |
done |
| 32381 | 73 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
74 |
shift $(($OPTIND - 1)) |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
75 |
|
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
76 |
ACTIONS="$1" |
| 32381 | 77 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
78 |
shift |
| 32381 | 79 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
80 |
|
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
81 |
# setup |
| 32381 | 82 |
|
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
83 |
mkdir -p "$MIRABELLE_OUTPUT_PATH" |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
84 |
|
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
85 |
|
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
86 |
## main |
| 32381 | 87 |
|
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
88 |
for FILE in "$@" |
|
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
89 |
do |
|
32397
1899b8c47961
more quoting for shell variables, canonical isabelle process
boehmes
parents:
32385
diff
changeset
|
90 |
perl -w "$MIRABELLE_HOME/lib/scripts/mirabelle.pl" "$ACTIONS" "$FILE" |
|
32382
98674ac811c4
Mirabelle tool script conforming to standard Isabelle tool interface,
boehmes
parents:
32381
diff
changeset
|
91 |
done |
| 32381 | 92 |