src/HOL/TPTP/lib/Tools/tptp_translate
author blanchet
Mon, 21 May 2012 10:39:31 +0200
changeset 47944 e6b51fab96f7
parent 46325 b170ab46513a
permissions -rwxr-xr-x
added helper -- cf. SET616^5

#!/usr/bin/env bash
#
# Author: Jasmin Blanchette
#
# DESCRIPTION: Translation tool for TPTP formats


PRG="$(basename "$0")"

function usage() {
  echo
  echo "Usage: isabelle $PRG FORMAT IN_FILE OUT_FILE"
  echo
  echo "  Translates TPTP input file to specified TPTP format (\"CNF\", \"FOF\", \"TFF0\", \"TFF1\", or \"THF0\")."
  echo
  exit 1
}

[ "$#" -ne 3 -o "$1" = "-?" ] && usage

SCRATCH="Scratch_${PRG}_$$_${RANDOM}"

args=("$@")

echo "theory $SCRATCH imports \"$TPTP_HOME/ATP_Problem_Import\" begin \
ML {* ATP_Problem_Import.translate_tptp_file \"${args[0]}\" \"${args[1]}\" \"${args[2]}\" *} end;" \
  > /tmp/$SCRATCH.thy
"$ISABELLE_PROCESS" -e "use_thy \"/tmp/$SCRATCH\"; exit 1;"