src/HOL/TPTP/lib/Tools/tptp_translate
changeset 46325 b170ab46513a
parent 46324 e4bccf5ec61e
equal deleted inserted replaced
46324:e4bccf5ec61e 46325:b170ab46513a
     7 
     7 
     8 PRG="$(basename "$0")"
     8 PRG="$(basename "$0")"
     9 
     9 
    10 function usage() {
    10 function usage() {
    11   echo
    11   echo
    12   echo "Usage: isabelle $PRG FORMAT FILE"
    12   echo "Usage: isabelle $PRG FORMAT IN_FILE OUT_FILE"
    13   echo
    13   echo
    14   echo "  Translates TPTP file to specified TPTP format (\"CNF\", \"FOF\", \"TFF0\", \"TFF1\", or \"THF0\")."
    14   echo "  Translates TPTP input file to specified TPTP format (\"CNF\", \"FOF\", \"TFF0\", \"TFF1\", or \"THF0\")."
    15   echo
    15   echo
    16   exit 1
    16   exit 1
    17 }
    17 }
    18 
    18 
    19 [ "$#" -eq 0 -o "$1" = "-?" ] && usage
    19 [ "$#" -ne 3 -o "$1" = "-?" ] && usage
    20 
    20 
    21 SCRATCH="Scratch_${PRG}_$$_${RANDOM}"
    21 SCRATCH="Scratch_${PRG}_$$_${RANDOM}"
    22 
    22 
    23 for FILE in "$@"
    23 args=("$@")
    24 do
    24 
    25   echo "theory $SCRATCH imports \"$TPTP_HOME/ATP_Problem_Import\" begin \
    25 echo "theory $SCRATCH imports \"$TPTP_HOME/ATP_Problem_Import\" begin \
    26 ML {* ATP_Problem_Import.translate_tptp_file \"$FILE\" *} end;" \
    26 ML {* ATP_Problem_Import.translate_tptp_file \"${args[0]}\" \"${args[1]}\" \"${args[2]}\" *} end;" \
    27     > /tmp/$SCRATCH.thy
    27   > /tmp/$SCRATCH.thy
    28   "$ISABELLE_PROCESS" -e "use_thy \"/tmp/$SCRATCH\"; exit 1;"
    28 "$ISABELLE_PROCESS" -e "use_thy \"/tmp/$SCRATCH\"; exit 1;"
    29 done