1#!/usr/bin/env bash 2# 3# Author: Jasmin Blanchette 4# 5# DESCRIPTION: Sledgehammer for TPTP 6 7 8PRG="$(basename "$0")" 9 10function usage() { 11 echo 12 echo "Usage: isabelle $PRG TIMEOUT FILES" 13 echo 14 echo " Runs Sledgehammer on TPTP problems." 15 echo " Each problem is allocated at most TIMEOUT seconds." 16 echo 17 exit 1 18} 19 20[ "$#" -eq 0 -o "$1" = "-?" ] && usage 21 22SCRATCH="Scratch_${PRG}_$$_${RANDOM}" 23 24TIMEOUT=$1 25shift 26 27isabelle build -b HOL-TPTP 2>&1 | grep --line-buffered -v "elapsed time$" 28 29for FILE in "$@" 30do 31 echo "theory $SCRATCH imports \"$TPTP_HOME/ATP_Problem_Import\" begin \ 32ML {* ATP_Problem_Import.sledgehammer_tptp_file @{theory} ($TIMEOUT) \"$FILE\" *} end" \ 33 > /tmp/$SCRATCH.thy 34 isabelle process -e "use_thy \"/tmp/$SCRATCH\"; exit 1;" -l HOL-TPTP | grep --line-buffered -v "^###\|^PROOF FAILED for depth\|^Failure node\|inferences so far. Searching to depth\|^val \|^Loading theory\|^poly.*warning: The type of\|^ monotype.$" 35done 36