src/HOL/TPTP/lib/Tools/tptp_isabelle
author wenzelm
Mon, 29 Feb 2016 20:35:06 +0100
changeset 62475 43e64c770f28
parent 60546 dcb0b9b42fcb
child 62573 27f90319a499
permissions -rwxr-xr-x
isabelle_process executable no longer supports writable heap images;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47832
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     1
#!/usr/bin/env bash
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     2
#
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     3
# Author: Jasmin Blanchette
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     4
#
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     5
# DESCRIPTION: Isabelle tactics for TPTP competitive division
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     6
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     7
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     8
PRG="$(basename "$0")"
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
     9
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    10
function usage() {
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    11
  echo
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    12
  echo "Usage: isabelle $PRG TIMEOUT FILES"
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    13
  echo
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    14
  echo "  Runs a combination of Isabelle tactics on TPTP problems."
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    15
  echo "  Each problem is allocated at most TIMEOUT seconds."
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    16
  echo
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    17
  exit 1
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    18
}
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    19
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    20
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    21
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    22
SCRATCH="Scratch_${PRG}_$$_${RANDOM}"
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    23
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    24
TIMEOUT=$1
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    25
shift
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    26
60546
dcb0b9b42fcb automatically build image
blanchet
parents: 60545
diff changeset
    27
isabelle build -b HOL-TPTP
dcb0b9b42fcb automatically build image
blanchet
parents: 60545
diff changeset
    28
47832
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    29
for FILE in "$@"
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    30
do
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    31
  echo "theory $SCRATCH imports \"$TPTP_HOME/ATP_Problem_Import\" begin \
60544
3daf5eacec05 removed (now illegal) semicolons in generated theory files
blanchet
parents: 54434
diff changeset
    32
ML {* ATP_Problem_Import.isabelle_tptp_file @{theory} ($TIMEOUT) \"$FILE\" *} end" \
47832
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    33
    > /tmp/$SCRATCH.thy
60545
bcd11dcd0d90 filter out more Poly/ML messages from (ad hoc) TPTP toools
blanchet
parents: 60544
diff changeset
    34
  "$ISABELLE_PROCESS" -q -e "use_thy \"/tmp/$SCRATCH\"; exit 1;" HOL-TPTP | grep --line-buffered -v "^###\|^PROOF FAILED for depth\|^Failure node\|inferences so far.  Searching to depth\|^val \|^Loading theory\|^Warning-The type of\|^   monotype.$"
47832
7df66b448c4a split into demo and competitive version
blanchet
parents:
diff changeset
    35
done