author | webertj |
Wed, 30 Aug 2006 16:27:53 +0200 | |
changeset 20440 | e6fe74eebda3 |
parent 19723 | 7602f74c914b |
child 22373 | c6002b06e63e |
permissions | -rw-r--r-- |
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
1 |
(* ID: $Id$ |
17907 | 2 |
Author: Jia Meng, NICTA |
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
3 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
4 |
Functions used for ATP Oracle. |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
5 |
*) |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
6 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
7 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
8 |
structure ResAtpProvers = |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
9 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
10 |
struct |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
11 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
12 |
fun if_proof_vampire instr = (TextIO.inputLine instr = "Refutation found. Thanks to Tanya!\n"); |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
13 |
|
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
14 |
fun if_proof_E instr = |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
15 |
let val thisLine = TextIO.inputLine instr |
19479 | 16 |
in thisLine <> "" andalso |
17 |
(thisLine = "# Proof found!\n" orelse if_proof_E instr) |
|
18 |
end; |
|
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
19 |
|
19723 | 20 |
fun if_proof_spass instr = |
21 |
let val thisLine = TextIO.inputLine instr |
|
22 |
in thisLine <> "" andalso |
|
23 |
(thisLine = "SPASS beiseite: Proof found.\n" orelse if_proof_spass instr) |
|
24 |
end; |
|
19129 | 25 |
|
18726 | 26 |
local |
27 |
||
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
28 |
fun location s = warning ("ATP input at: " ^ s); |
18726 | 29 |
|
30 |
in |
|
31 |
||
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
32 |
fun call_vampire (file:string, time: int) = |
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
33 |
let val _ = location file |
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
34 |
val runtime = "-t " ^ (string_of_int time) |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
35 |
val vampire = ResAtp.helper_path "VAMPIRE_HOME" "vampire" |
19479 | 36 |
val ch:(TextIO.instream,TextIO.outstream) Unix.proc = |
37 |
Unix.execute(vampire, [runtime,file]) |
|
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
38 |
val (instr,outstr) = Unix.streamsOf ch |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
39 |
in if_proof_vampire instr |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
40 |
end; |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
41 |
|
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
42 |
fun call_eprover (file:string, time:int) = |
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
43 |
let val _ = location file |
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
44 |
val eprover = ResAtp.helper_path "E_HOME" "/PROVER/eprover" |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
45 |
val runtime = "--cpu-limit=" ^ (string_of_int time) |
19479 | 46 |
val ch:(TextIO.instream,TextIO.outstream) Unix.proc = |
47 |
Unix.execute(eprover, [runtime,"--tptp-format","-tAuto","-xAuto",file]) |
|
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
48 |
val (instr,outstr) = Unix.streamsOf ch |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
49 |
in if_proof_E instr |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
50 |
end; |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
51 |
|
19723 | 52 |
fun call_spass (file:string, time:int) = |
53 |
let val _ = location file |
|
54 |
val runtime = "-TimeLimit=" ^ (string_of_int time) |
|
55 |
val spass = ResAtp.helper_path "SPASS_HOME" "SPASS" |
|
56 |
val ch:(TextIO.instream,TextIO.outstream) Unix.proc = |
|
57 |
Unix.execute(spass, [runtime,"-Splits=0", "-FullRed=0", "-SOS=1",file]) |
|
58 |
val (instr,outstr) = Unix.streamsOf ch |
|
59 |
in if_proof_spass instr |
|
60 |
end; |
|
61 |
||
62 |
||
18726 | 63 |
end |
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
64 |
|
19479 | 65 |
fun vampire_o _ (file,time) = |
66 |
if call_vampire (file,time) |
|
67 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
|
68 |
else (ResAtp.cond_rm_tmp file; raise Fail ("vampire oracle failed")); |
|
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
69 |
|
19479 | 70 |
fun eprover_o _ (file,time) = |
71 |
if call_eprover (file,time) |
|
72 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
|
73 |
else (ResAtp.cond_rm_tmp file; raise Fail ("eprover oracle failed")); |
|
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
74 |
|
19723 | 75 |
fun spass_o _ (file,time) = |
76 |
if call_spass (file,time) |
|
77 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
|
78 |
else (ResAtp.cond_rm_tmp file; raise Fail ("SPASS oracle failed")); |
|
79 |
||
80 |
||
17905
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
81 |
end; |
1574533861b1
Added files in order to use external ATPs as oracles and invoke these ATPs by calling Isabelle methods (currently "vampire" and "eprover").
mengj
parents:
diff
changeset
|
82 |