author | wenzelm |
Tue, 10 Jun 2008 19:15:16 +0200 | |
changeset 27123 | 11fcdd5897dd |
parent 23139 | aa899bce7c3b |
child 28290 | 4cc2b6046258 |
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 |
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
|
8 |
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
|
9 |
|
22373 | 10 |
fun seek_line s instr = |
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
11 |
(case TextIO.inputLine instr of |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
12 |
NONE => false |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
13 |
| SOME thisLine => thisLine = s orelse seek_line s instr); |
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
|
14 |
|
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
15 |
fun location s = warning ("ATP input at: " ^ s); |
18726 | 16 |
|
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
17 |
fun call_vampire (file:string, time: int) = |
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
18 |
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
|
19 |
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
|
20 |
val vampire = ResAtp.helper_path "VAMPIRE_HOME" "vampire" |
22373 | 21 |
val (instr,outstr) = Unix.streamsOf (Unix.execute(vampire, [runtime,"--mode casc",file])) |
22 |
in seek_line "--------------------- PROVED ----------------------\n" instr |
|
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
|
23 |
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
|
24 |
|
19195
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
25 |
fun call_eprover (file:string, time:int) = |
e0b483dea2c0
Moved the settings for ATP time limit to res_atp.ML
mengj
parents:
19129
diff
changeset
|
26 |
let val _ = location file |
22373 | 27 |
val eprover = ResAtp.helper_path "E_HOME" "eprover" |
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
|
28 |
val runtime = "--cpu-limit=" ^ (string_of_int time) |
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
29 |
val (instr,outstr) = Unix.streamsOf (Unix.execute(eprover, |
22373 | 30 |
[runtime,"--tstp-in","-tAutoDev","-xAutoDev",file])) |
31 |
in seek_line "# Proof found!\n" instr |
|
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
32 |
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
|
33 |
|
19723 | 34 |
fun call_spass (file:string, time:int) = |
22373 | 35 |
let val _ = location file |
36 |
val runtime = "-TimeLimit=" ^ (string_of_int time) |
|
37 |
val spass = ResAtp.helper_path "SPASS_HOME" "SPASS" |
|
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
38 |
val (instr,outstr) = Unix.streamsOf (Unix.execute(spass, |
22373 | 39 |
[runtime,"-Splits=0", "-FullRed=0", "-SOS=1",file])) |
40 |
in seek_line "SPASS beiseite: Proof found.\n" instr |
|
41 |
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
|
42 |
|
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
43 |
fun vampire_o _ (file,time) = |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
44 |
if call_vampire (file,time) |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
45 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
19479 | 46 |
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
|
47 |
|
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
48 |
fun eprover_o _ (file,time) = |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
49 |
if call_eprover (file,time) |
19479 | 50 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
51 |
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
|
52 |
|
19723 | 53 |
fun spass_o _ (file,time) = |
23139
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
54 |
if call_spass (file,time) |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
55 |
then (warning file; ResAtp.cond_rm_tmp file; HOLogic.mk_Trueprop HOLogic.false_const) |
aa899bce7c3b
TextIO.inputLine: use present SML B library version;
wenzelm
parents:
22373
diff
changeset
|
56 |
else (ResAtp.cond_rm_tmp file; raise Fail ("SPASS oracle failed")); |
19723 | 57 |
|
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
|
58 |
end; |