src/HOL/TPTP/lib/Tools/tptp_nitpick
changeset 46319 c248e4f1be74
parent 46318 8038d050ff15
child 46324 e4bccf5ec61e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/TPTP/lib/Tools/tptp_nitpick	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: Nitpick for TPTP
     1.9 +
    1.10 +
    1.11 +PRG="$(basename "$0")"
    1.12 +
    1.13 +function usage() {
    1.14 +  echo
    1.15 +  echo "Usage: isabelle $PRG FILES"
    1.16 +  echo
    1.17 +  echo "  Runs Nitpick on TPTP problems."
    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 {* Nitpick_TPTP.pick_nits_in_tptp_file \"$FILE\" *} end;" \
    1.29 +    > /tmp/$SCRATCH.thy
    1.30 +  "$ISABELLE_PROCESS" -e "use_thy \"/tmp/$SCRATCH\"; exit 1;"
    1.31 +done