| author | nipkow |
| Tue, 11 Nov 2025 09:19:46 +0100 | |
| changeset 83547 | db80ee4abed1 |
| parent 83354 | ea5f530ccfc5 |
| permissions | -rwxr-xr-x |
| 54433 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Jasmin Blanchette |
|
|
83354
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
4 |
# Author: Martin Desharnais-Schäfer |
| 54433 | 5 |
# |
6 |
# DESCRIPTION: translate between TPTP formats |
|
7 |
||
8 |
PRG="$(basename "$0")" |
|
9 |
||
10 |
function usage() {
|
|
11 |
echo |
|
|
54472
073f041d83ae
send output of "tptp_translate" to standard output, to simplify Geoff Sutcliffe's life
blanchet
parents:
54434
diff
changeset
|
12 |
echo "Usage: isabelle $PRG FORMAT FILE" |
| 54433 | 13 |
echo |
|
54547
c999e2533487
renamed TFF0/THF0 to three-letter acronyms, in keeping with new TPTP policy
blanchet
parents:
54472
diff
changeset
|
14 |
echo " Translates TPTP input file to the specified format (\"FOF\", \"TF0\", \"TH0\", or \"DFG\")." |
|
54472
073f041d83ae
send output of "tptp_translate" to standard output, to simplify Geoff Sutcliffe's life
blanchet
parents:
54434
diff
changeset
|
15 |
echo " Emits the result to standard output." |
| 54433 | 16 |
echo |
17 |
exit 1 |
|
18 |
} |
|
19 |
||
|
54472
073f041d83ae
send output of "tptp_translate" to standard output, to simplify Geoff Sutcliffe's life
blanchet
parents:
54434
diff
changeset
|
20 |
[ "$#" -ne 2 -o "$1" = "-?" ] && usage |
| 54433 | 21 |
|
22 |
SCRATCH="Scratch_${PRG}_$$_${RANDOM}"
|
|
|
83354
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
23 |
SCRATCH_FILE=/tmp/${SCRATCH}.thy
|
| 54433 | 24 |
|
25 |
args=("$@")
|
|
26 |
||
|
83354
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
27 |
echo "theory ${SCRATCH} imports \"HOL-TPTP.ATP_Problem_Import\" begin \
|
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
28 |
ML \<open> ATP_Problem_Import.translate_tptp_file @{theory} \"${args[0]}\" \"${args[1]}\" \<close> end" \
|
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
29 |
> "${SCRATCH_FILE}"
|
| 60546 | 30 |
|
|
83354
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
31 |
isabelle process_theories -O -U -l HOL-TPTP -f "${SCRATCH_FILE}" "${SCRATCH}" \
|
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
32 |
| grep --line-buffered -vE \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
33 |
-e '^Running Draft ...$' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
34 |
-e '^[[:space:]]*$' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
35 |
-e '^Output \(line [[:digit:]]+ of ".*"):$' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
36 |
-e '^val it = \(\): unit$' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
37 |
-e '^Finished Draft \([0-9:]+ elapsed time(, [0-9:]+ cpu time, factor [0-9.]+)?\)$' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
38 |
-e '^PROOF FAILED for depth' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
39 |
-e '^Failure node' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
40 |
-e 'inferences so far. Searching to depth' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
41 |
-e '^val ' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
42 |
-e 'Loading theory' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
43 |
-e '^poly.*warning: The type of' \ |
|
ea5f530ccfc5
adapted tptp_translate to use new process_theory command
desharna
parents:
81527
diff
changeset
|
44 |
-e '^ monotype.$' |