src/HOL/TPTP/lib/Tools/tptp_translate
changeset 46319 c248e4f1be74
child 46320 0b8b73b49848
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/TPTP/lib/Tools/tptp_translate	Mon Jan 23 17:40:31 2012 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +#!/usr/bin/env bash
     1.5 +#
     1.6 +# Author: Jasmin Blanchette
     1.7 +#
     1.8 +# DESCRIPTION: Translation tool for TPTP formats
     1.9 +
    1.10 +
    1.11 +PRG="$(basename "$0")"
    1.12 +
    1.13 +function usage() {
    1.14 +  echo
    1.15 +  echo "Usage: isabelle $PRG FORMAT FILE"
    1.16 +  echo
    1.17 +  echo "  Translates TPTP file to specified TPTP format (\"CNF\", \"FOF\", \"TFF0\", \"TFF1\", or \"THF0\")."
    1.18 +  echo
    1.19 +  exit 1
    1.20 +}
    1.21 +
    1.22 +[ "$#" -eq 0 -o "$1" = "-?" ] && usage
    1.23 +
    1.24 +SCRATCH="Scratch_${PRG}_$$_${RANDOM}"
    1.25 +
    1.26 +for FILE in "$@"
    1.27 +do
    1.28 +  echo "theory $SCRATCH imports \"Main\" begin ML {* ATP_Translate.translate_tptp_file \"$FILE\" *} end;" \
    1.29 +    > /tmp/$SCRATCH.thy
    1.30 +  "$ISABELLE_PROCESS" -e "use_thy \"/tmp/$SCRATCH\"; exit 1;"
    1.31 +done