src/HOL/Tools/Mirabelle/lib/Tools/mirabelle
changeset 32385 594890623c46
parent 32383 521065a499c6
child 32397 1899b8c47961
equal deleted inserted replaced
32384:8629581acc0b 32385:594890623c46
     5 # DESCRIPTION: testing tool for automated proof tools
     5 # DESCRIPTION: testing tool for automated proof tools
     6 
     6 
     7 
     7 
     8 PRG="$(basename "$0")"
     8 PRG="$(basename "$0")"
     9 
     9 
       
    10 function action_names() {
       
    11   TOOLS="$MIRABELLE_HOME/Tools/mirabelle_*.ML"
       
    12   ACTION_NAMES=`find $TOOLS | sed 's/.*mirabelle_\(.*\)\.ML/\1/'`
       
    13 }
       
    14 
    10 function usage() {
    15 function usage() {
    11   out="$MIRABELLE_OUTPUT_PATH"
    16   out="$MIRABELLE_OUTPUT_PATH"
    12   timeout="$MIRABELLE_TIMEOUT"
    17   timeout="$MIRABELLE_TIMEOUT"
       
    18   action_names
    13   echo
    19   echo
    14   echo "Usage: isabelle $PRG [OPTIONS] ACTIONS FILES"
    20   echo "Usage: isabelle $PRG [OPTIONS] ACTIONS FILES"
    15   echo
    21   echo
    16   echo "  Options are:"
    22   echo "  Options are:"
    17   echo "    -L LOGIC     parent logic to use (default $ISABELLE_LOGIC)"
    23   echo "    -L LOGIC     parent logic to use (default $ISABELLE_LOGIC)"
       
    24   echo "    -T THEORY    parent theory to use (default $MIRABELLE_THEORY)"
    18   echo "    -O DIR       output directory for test data (default $out)"
    25   echo "    -O DIR       output directory for test data (default $out)"
    19   echo "    -v           be verbose"
    26   echo "    -v           be verbose"
    20   echo "    -t TIMEOUT   timeout for each action in seconds (default $timeout)"
    27   echo "    -t TIMEOUT   timeout for each action in seconds (default $timeout)"
    21   echo
    28   echo
    22   echo "  Apply the given actions (i.e., automated proof tools)"
    29   echo "  Apply the given actions (i.e., automated proof tools)"
    23   echo "  at all proof steps in the given theory files."
    30   echo "  at all proof steps in the given theory files."
    24   echo
    31   echo
    25   echo "  ACTIONS is a colon-separated list of actions, where each action is"
    32   echo "  ACTIONS is a colon-separated list of actions, where each action is"
    26   echo "  either NAME or NAME[KEY=VALUE,...,KEY=VALUE]."
    33   echo "  either NAME or NAME[KEY=VALUE,...,KEY=VALUE]. Available actions are:"
       
    34   for NAME in $ACTION_NAMES
       
    35   do
       
    36     echo "    $NAME"
       
    37   done
    27   echo
    38   echo
    28   echo "  FILES is a space-separated list of theory files, where each file is"
    39   echo "  FILES is a space-separated list of theory files, where each file is"
    29   echo "  either NAME.thy or NAME.thy[START:END] and START and END are numbers"
    40   echo "  either NAME.thy or NAME.thy[START:END] and START and END are numbers"
    30   echo "  indicating the range the given actions are to be applied."
    41   echo "  indicating the range the given actions are to be applied."
    31   echo
    42   echo
    35 
    46 
    36 ## process command line
    47 ## process command line
    37 
    48 
    38 # options
    49 # options
    39 
    50 
    40 while getopts "L:O:vt:" OPT
    51 while getopts "L:T:O:vt:" OPT
    41 do
    52 do
    42   case "$OPT" in
    53   case "$OPT" in
    43     L)
    54     L)
    44       MIRABELLE_LOGIC="$OPTARG"
    55       MIRABELLE_LOGIC="$OPTARG"
       
    56       ;;
       
    57     T)
       
    58       MIRABELLE_THEORY="$OPTARG"
    45       ;;
    59       ;;
    46     O)
    60     O)
    47       MIRABELLE_OUTPUT_PATH="$OPTARG"
    61       MIRABELLE_OUTPUT_PATH="$OPTARG"
    48       ;;
    62       ;;
    49     v)
    63     v)