| author | wenzelm |
| Thu, 02 Jun 2005 18:29:52 +0200 | |
| changeset 16192 | 733267a60e32 |
| parent 16185 | bb71c91e781e |
| child 16260 | 4a1f36eafe17 |
| permissions | -rw-r--r-- |
|
15789
4cb16144c81b
added hearder lines and deleted some redundant material
paulson
parents:
15787
diff
changeset
|
1 |
(* Title: Watcher.ML |
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
2 |
|
|
15789
4cb16144c81b
added hearder lines and deleted some redundant material
paulson
parents:
15787
diff
changeset
|
3 |
ID: $Id$ |
|
4cb16144c81b
added hearder lines and deleted some redundant material
paulson
parents:
15787
diff
changeset
|
4 |
Author: Claire Quigley |
|
4cb16144c81b
added hearder lines and deleted some redundant material
paulson
parents:
15787
diff
changeset
|
5 |
Copyright 2004 University of Cambridge |
| 15642 | 6 |
*) |
7 |
||
8 |
(***************************************************************************) |
|
9 |
(* The watcher process starts a resolution process when it receives a *) |
|
10 |
(* message from Isabelle *) |
|
11 |
(* Signals Isabelle, puts output of child into pipe to Isabelle, *) |
|
12 |
(* and removes dead processes. Also possible to kill all the resolution *) |
|
13 |
(* processes currently running. *) |
|
14 |
(* Hardwired version of where to pick up the tptp files for the moment *) |
|
15 |
(***************************************************************************) |
|
16 |
||
17 |
(*use "Proof_Transfer"; |
|
18 |
use "VampireCommunication"; |
|
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
19 |
use "SpassCommunication";*) |
| 15642 | 20 |
(*use "/homes/clq20/Jia_Code/TransStartIsar";*) |
21 |
||
22 |
||
23 |
structure Watcher: WATCHER = |
|
24 |
struct |
|
25 |
||
26 |
val goals_being_watched = ref 0; |
|
27 |
||
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
28 |
(*****************************************) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
29 |
(* The result of calling createWatcher *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
30 |
(*****************************************) |
| 15642 | 31 |
|
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
32 |
datatype proc = PROC of {
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
33 |
pid : Posix.Process.pid, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
34 |
instr : TextIO.instream, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
35 |
outstr : TextIO.outstream |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
36 |
}; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
37 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
38 |
(*****************************************) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
39 |
(* The result of calling executeToList *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
40 |
(*****************************************) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
41 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
42 |
datatype cmdproc = CMDPROC of {
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
43 |
prover: string, (* Name of the resolution prover used, e.g. Vampire, SPASS *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
44 |
cmd: string, (* The file containing the goal for res prover to prove *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
45 |
thmstring: string, (* string representation of subgoal after negation, skolemization*) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
46 |
goalstring: string, (* string representation of subgoal*) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
47 |
proc_handle : (TextIO.instream,TextIO.outstream) Unix.proc, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
48 |
instr : TextIO.instream, (* Input stream to child process *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
49 |
outstr : TextIO.outstream (* Output stream from child process *) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
50 |
}; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
51 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
52 |
type signal = Posix.Signal.signal |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
53 |
datatype exit_status = datatype Posix.Process.exit_status |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
54 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
55 |
val fromStatus = Posix.Process.fromStatus |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
56 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
57 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
58 |
fun reap(pid, instr, outstr) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
59 |
let |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
60 |
val u = TextIO.closeIn instr; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
61 |
val u = TextIO.closeOut outstr; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
62 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
63 |
val (_, status) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
64 |
Posix.Process.waitpid(Posix.Process.W_CHILD pid, []) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
65 |
in |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
66 |
status |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
67 |
end |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
68 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
69 |
fun fdReader (name : string, fd : Posix.IO.file_desc) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
70 |
Posix.IO.mkTextReader {initBlkMode = true,name = name,fd = fd };
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
71 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
72 |
fun fdWriter (name, fd) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
73 |
Posix.IO.mkTextWriter {
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
74 |
appendMode = false, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
75 |
initBlkMode = true, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
76 |
name = name, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
77 |
chunkSize=4096, |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
78 |
fd = fd |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
79 |
}; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
80 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
81 |
fun openOutFD (name, fd) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
82 |
TextIO.mkOutstream ( |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
83 |
TextIO.StreamIO.mkOutstream ( |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
84 |
fdWriter (name, fd), IO.BLOCK_BUF)); |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
85 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
86 |
fun openInFD (name, fd) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
87 |
TextIO.mkInstream ( |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
88 |
TextIO.StreamIO.mkInstream ( |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
89 |
fdReader (name, fd), "")); |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
90 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
91 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
92 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
93 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
94 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
95 |
fun killChild child_handle = Unix.reap child_handle |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
96 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
97 |
fun childInfo (PROC{pid,instr,outstr }) = (pid,(instr,outstr));
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
98 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
99 |
fun cmdstreamsOf (CMDPROC{instr,outstr,...}) = (instr, outstr);
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
100 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
101 |
fun cmdInStream (CMDPROC{instr,outstr,...}) = (instr);
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
102 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
103 |
fun cmdchildInfo (CMDPROC{prover,cmd,thmstring,proc_handle,goalstring,instr,outstr}) = (prover,(cmd, (instr,outstr)));
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
104 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
105 |
fun cmdchildHandle (CMDPROC{prover,cmd,thmstring,goalstring,proc_handle,instr,outstr}) = proc_handle;
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
106 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
107 |
fun cmdProver (CMDPROC{prover,cmd,thmstring,goalstring,proc_handle,instr,outstr}) = (prover);
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
108 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
109 |
fun cmdThm (CMDPROC{prover,cmd,thmstring,goalstring,proc_handle,instr,outstr}) = (thmstring);
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
110 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
111 |
fun cmdGoal (CMDPROC{prover,cmd,thmstring,goalstring,proc_handle,instr,outstr}) = (goalstring);
|
| 15642 | 112 |
|
113 |
fun sendOutput (outstr,str) = (TextIO.outputSubstr (outstr, (Substring.all str));TextIO.flushOut outstr); |
|
114 |
||
115 |
(********************************************************************************************) |
|
116 |
(* takes a list of arguments and sends them individually to the watcher process by pipe *) |
|
117 |
(********************************************************************************************) |
|
118 |
||
119 |
fun outputArgs (toWatcherStr, []) = () |
|
120 |
| outputArgs (toWatcherStr, (x::xs)) = (TextIO.output (toWatcherStr, x); |
|
121 |
TextIO.flushOut toWatcherStr; |
|
122 |
outputArgs (toWatcherStr, xs)) |
|
123 |
||
124 |
(********************************************************************************) |
|
125 |
(* gets individual args from instream and concatenates them into a list *) |
|
126 |
(********************************************************************************) |
|
127 |
||
128 |
fun getArgs (fromParentStr, toParentStr,ys) = let |
|
129 |
val thisLine = TextIO.input fromParentStr |
|
130 |
in |
|
131 |
((ys@[thisLine])) |
|
132 |
end |
|
133 |
||
134 |
(********************************************************************************) |
|
135 |
(* Remove the \n character from the end of each filename *) |
|
136 |
(********************************************************************************) |
|
137 |
||
138 |
fun getCmd cmdStr = let val backList = ((rev(explode cmdStr))) |
|
139 |
in |
|
140 |
if (String.isPrefix "\n" (implode backList )) |
|
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
141 |
then (implode (rev ((tl backList)))) |
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
142 |
else cmdStr |
| 15642 | 143 |
end |
144 |
||
145 |
(********************************************************************************) |
|
146 |
(* Send request to Watcher for a vampire to be called for filename in arg *) |
|
147 |
(********************************************************************************) |
|
148 |
||
149 |
fun callResProver (toWatcherStr, arg) = (sendOutput (toWatcherStr, arg^"\n"); |
|
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
150 |
TextIO.flushOut toWatcherStr) |
| 15642 | 151 |
|
152 |
(*****************************************************************************************) |
|
153 |
(* Send request to Watcher for multiple provers to be called for filenames in arg *) |
|
154 |
(*****************************************************************************************) |
|
155 |
||
156 |
(* need to modify to send over hyps file too *) |
|
| 16100 | 157 |
fun callResProvers (toWatcherStr, []) = |
158 |
(sendOutput (toWatcherStr, "End of calls\n"); |
|
159 |
TextIO.flushOut toWatcherStr) |
|
| 15782 | 160 |
| callResProvers (toWatcherStr,(prover,thmstring,goalstring, proverCmd,settings,clasimpfile, axfile, hypsfile,probfile)::args) = |
| 16061 | 161 |
let val dfg_dir = File.tmp_path (Path.basic "dfg"); |
162 |
(*** need to check here if the directory exists and, if not, create it***) |
|
| 16100 | 163 |
val _ = File.append (File.tmp_path (Path.basic"thmstring_in_watcher")) |
164 |
(thmstring^"\n goals_watched"^(string_of_int(!goals_being_watched))^"\n") |
|
| 16061 | 165 |
(*** want to cat clasimp ax hyps prob, then send the resulting file to tptp2x ***) |
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
166 |
val probID = ReconOrderClauses.last(explode probfile) |
| 16061 | 167 |
val wholefile = File.tmp_path (Path.basic ("ax_prob_"^probID))
|
168 |
(*** only include problem and clasimp for the moment, not sure how to refer to ***) |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
169 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
170 |
(*** hyps/local axioms just now (*,axfile, hypsfile,*) ***) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
171 |
val whole_prob_file = system ("/bin/cat " ^ clasimpfile ^" "^ probfile ^ " > " ^ (File.sysify_path wholefile))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
172 |
|
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
173 |
val dfg_create = if File.exists dfg_dir |
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
174 |
then warning("dfg dir exists")
|
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
175 |
else File.mkdir dfg_dir; |
| 16061 | 176 |
|
177 |
val dfg_path = File.sysify_path dfg_dir; |
|
| 16185 | 178 |
(* val exec_tptp2x = |
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
179 |
Unix.execute(getenv "TPTP2X_HOME" ^ "/tptp2X", |
| 16185 | 180 |
["-fdfg", "-d " ^ dfg_path, File.sysify_path wholefile]) *) |
181 |
val tptp_home = getenv "TPTP2X_HOME" ^ "/tptp2X" |
|
182 |
||
183 |
val systemcall = system (tptp_home^" -fdfg -d " ^ dfg_path^" "^( File.sysify_path wholefile)) |
|
184 |
val _ = warning("systemcall is "^ (string_of_int systemcall))
|
|
| 16061 | 185 |
(*val _ = Posix.Process.wait ()*) |
186 |
(*val _ =Unix.reap exec_tptp2x*) |
|
187 |
val newfile = dfg_path^"/ax_prob"^"_"^(probID)^".dfg" |
|
188 |
||
189 |
in |
|
190 |
goals_being_watched := (!goals_being_watched) + 1; |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
191 |
Posix.Process.sleep(Time.fromSeconds 1); |
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
192 |
(warning ("probfile is: "^probfile));
|
| 16061 | 193 |
(warning("dfg file is: "^newfile));
|
194 |
(warning ("wholefile is: "^(File.sysify_path wholefile)));
|
|
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
195 |
sendOutput (toWatcherStr, |
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
196 |
prover ^ "*" ^ thmstring ^ "*" ^ goalstring ^ "*" ^ proverCmd ^ |
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
197 |
"*" ^ settings ^ "*" ^ newfile ^ "\n"); |
| 16061 | 198 |
(*sendOutput (toWatcherStr, (prover^"*"^thmstring^"*"^goalstring^"*"^proverCmd^"*"^settings^"*"^"/homes/clq20/IsabelleCVS/isabelle/HOL/Tools/ATP/dfg/mini_p1.dfg"^"\n"));*) |
199 |
TextIO.flushOut toWatcherStr; |
|
| 16185 | 200 |
(*Unix.reap exec_tptp2x;*) |
|
16089
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
201 |
if File.exists |
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
202 |
(Path.append dfg_dir (Path.basic ("ax_prob"^"_" ^ probID ^ ".dfg")))
|
|
9169bdf930f8
trying to set up portable calling sequences for SPASS and tptp2X
paulson
parents:
16061
diff
changeset
|
203 |
then callResProvers (toWatcherStr, args) |
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
204 |
else error ("tptp2X failed: " ^ getenv "TPTP2X_HOME" ^ "/tptp2X" ^
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
205 |
" -fdfg " ^ File.sysify_path wholefile ^ " -d " ^ dfg_path) |
| 16061 | 206 |
end |
| 15782 | 207 |
(* |
| 15642 | 208 |
fun callResProversStr (toWatcherStr, []) = "End of calls\n" |
209 |
||
| 15782 | 210 |
| callResProversStr (toWatcherStr,(prover,thmstring,goalstring, proverCmd,settings,clasimpfile, axfile, hypsfile, probfile)::args) = |
211 |
((prover^"*"^thmstring^"*"^goalstring^"*"^proverCmd^"*"^settings^"*"^clasimpfile^"*"^axfile^"*"^hypsfile^"*"^probfile^"\n") |
|
| 15642 | 212 |
|
| 15782 | 213 |
*) |
| 15642 | 214 |
|
215 |
(**************************************************************) |
|
216 |
(* Send message to watcher to kill currently running vampires *) |
|
217 |
(**************************************************************) |
|
218 |
||
219 |
fun callSlayer (toWatcherStr) = (sendOutput (toWatcherStr, "Kill vampires\n"); |
|
220 |
TextIO.flushOut toWatcherStr) |
|
221 |
||
222 |
||
223 |
||
224 |
(**************************************************************) |
|
225 |
(* Remove \n token from a vampire goal filename and extract *) |
|
226 |
(* prover, proverCmd, settings and file from input string *) |
|
227 |
(**************************************************************) |
|
228 |
||
229 |
||
230 |
fun takeUntil ch [] res = (res, []) |
|
231 |
| takeUntil ch (x::xs) res = if x = ch |
|
232 |
then |
|
233 |
(res, xs) |
|
234 |
else |
|
235 |
takeUntil ch xs (res@[x]) |
|
236 |
||
237 |
fun getSettings [] settings = settings |
|
238 |
| getSettings (xs) settings = let val (set, rest ) = takeUntil "%" xs [] |
|
239 |
in |
|
240 |
getSettings rest (settings@[(implode set)]) |
|
241 |
end |
|
242 |
||
| 16100 | 243 |
fun separateFields str = |
244 |
let val (prover, rest) = takeUntil "*" str [] |
|
245 |
val prover = implode prover |
|
246 |
val (thmstring, rest) = takeUntil "*" rest [] |
|
247 |
val thmstring = implode thmstring |
|
248 |
val (goalstring, rest) = takeUntil "*" rest [] |
|
249 |
val goalstring = implode goalstring |
|
250 |
val (proverCmd, rest ) = takeUntil "*" rest [] |
|
251 |
val proverCmd = implode proverCmd |
|
252 |
||
253 |
val (settings, rest) = takeUntil "*" rest [] |
|
254 |
val settings = getSettings settings [] |
|
255 |
val (file, rest) = takeUntil "*" rest [] |
|
256 |
val file = implode file |
|
257 |
val _ = File.write (File.tmp_path (Path.basic "sep_comms")) |
|
258 |
(prover^thmstring^goalstring^proverCmd^file) |
|
259 |
in |
|
260 |
(prover,thmstring,goalstring, proverCmd, settings, file) |
|
261 |
end |
|
| 15642 | 262 |
|
263 |
||
264 |
||
265 |
fun getCmd cmdStr = let val backList = ((rev(explode cmdStr))) |
|
266 |
in |
|
267 |
||
268 |
if (String.isPrefix "\n" (implode backList )) |
|
269 |
then |
|
270 |
separateFields ((rev ((tl backList)))) |
|
271 |
else |
|
272 |
(separateFields (explode cmdStr)) |
|
273 |
end |
|
274 |
||
275 |
||
276 |
fun getProofCmd (a,b,c,d,e,f) = d |
|
277 |
||
278 |
||
279 |
(**************************************************************) |
|
280 |
(* Get commands from Isabelle *) |
|
281 |
(**************************************************************) |
|
282 |
||
283 |
fun getCmds (toParentStr,fromParentStr, cmdList) = |
|
| 16100 | 284 |
let val thisLine = TextIO.inputLine fromParentStr |
285 |
in |
|
286 |
(if (thisLine = "End of calls\n") |
|
287 |
then |
|
288 |
(cmdList) |
|
289 |
else if (thisLine = "Kill children\n") |
|
290 |
then |
|
291 |
( TextIO.output (toParentStr,thisLine ); |
|
292 |
TextIO.flushOut toParentStr; |
|
293 |
(("","","","Kill children",[],"")::cmdList)
|
|
294 |
) |
|
295 |
else (let val thisCmd = getCmd (thisLine) (* thisCmd = (prover,thmstring,proverCmd, settings, file)*) |
|
296 |
in |
|
297 |
(*TextIO.output (toParentStr, thisCmd); |
|
298 |
TextIO.flushOut toParentStr;*) |
|
299 |
getCmds (toParentStr,fromParentStr, (thisCmd::cmdList)) |
|
300 |
end |
|
301 |
) |
|
302 |
) |
|
303 |
end |
|
| 15642 | 304 |
|
305 |
||
306 |
(**************************************************************) |
|
307 |
(* Get Io-descriptor for polling of an input stream *) |
|
308 |
(**************************************************************) |
|
309 |
||
310 |
||
311 |
fun getInIoDesc someInstr = |
|
312 |
let val (rd, buf) = TextIO.StreamIO.getReader(TextIO.getInstream someInstr) |
|
|
15702
2677db44c795
new signalling primmitives for sml/nj compatibility
paulson
parents:
15684
diff
changeset
|
313 |
val _ = TextIO.output (TextIO.stdOut, buf) |
| 15642 | 314 |
val ioDesc = |
315 |
case rd |
|
316 |
of TextPrimIO.RD{ioDesc = SOME iod, ...} =>SOME iod
|
|
317 |
| _ => NONE |
|
318 |
in (* since getting the reader will have terminated the stream, we need |
|
319 |
* to build a new stream. *) |
|
320 |
TextIO.setInstream(someInstr, TextIO.StreamIO.mkInstream(rd, buf)); |
|
321 |
ioDesc |
|
322 |
end |
|
323 |
||
324 |
||
325 |
(*************************************) |
|
326 |
(* Set up a Watcher Process *) |
|
327 |
(*************************************) |
|
328 |
||
329 |
||
330 |
||
| 16061 | 331 |
fun setupWatcher (thm,clause_arr, num_of_clauses) = |
332 |
let |
|
333 |
(** pipes for communication between parent and watcher **) |
|
334 |
val p1 = Posix.IO.pipe () |
|
335 |
val p2 = Posix.IO.pipe () |
|
336 |
fun closep () = ( |
|
337 |
Posix.IO.close (#outfd p1); |
|
338 |
Posix.IO.close (#infd p1); |
|
339 |
Posix.IO.close (#outfd p2); |
|
340 |
Posix.IO.close (#infd p2) |
|
341 |
) |
|
342 |
(***********************************************************) |
|
343 |
(****** fork a watcher process and get it set up and going *) |
|
344 |
(***********************************************************) |
|
345 |
fun startWatcher (procList) = |
|
346 |
(case Posix.Process.fork() (***************************************) |
|
347 |
of SOME pid => pid (* parent - i.e. main Isabelle process *) |
|
348 |
(***************************************) |
|
349 |
||
350 |
(*************************) |
|
351 |
| NONE => let (* child - i.e. watcher *) |
|
352 |
val oldchildin = #infd p1 (*************************) |
|
353 |
val fromParent = Posix.FileSys.wordToFD 0w0 |
|
354 |
val oldchildout = #outfd p2 |
|
355 |
val toParent = Posix.FileSys.wordToFD 0w1 |
|
356 |
val fromParentIOD = Posix.FileSys.fdToIOD fromParent |
|
357 |
val fromParentStr = openInFD ("_exec_in_parent", fromParent)
|
|
358 |
val toParentStr = openOutFD ("_exec_out_parent", toParent)
|
|
359 |
val sign = sign_of_thm thm |
|
360 |
val prems = prems_of thm |
|
361 |
val prems_string = Meson.concat_with_and (map (Sign.string_of_term sign) prems) |
|
362 |
val _ = (warning ("subgoals forked to startWatcher: "^prems_string));
|
|
363 |
(* tracing *) |
|
364 |
(*val tenth_ax = fst( Array.sub(clause_arr, 1)) |
|
365 |
val tenth_ax_thms = memo_find_clause (tenth_ax, clause_tab) |
|
366 |
val clause_str = Meson.concat_with_and (map string_of_thm tenth_ax_thms) |
|
367 |
val _ = (warning ("tenth axiom in array in watcher is: "^tenth_ax))
|
|
368 |
val _ = (warning ("tenth axiom in table in watcher is: "^clause_str))
|
|
369 |
val _ = (warning ("num_of_clauses in watcher is: "^(string_of_int (num_of_clauses))) )
|
|
370 |
*) |
|
371 |
(*val goalstr = string_of_thm (the_goal) |
|
372 |
val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "goal_in_watcher"))); |
|
373 |
val _ = TextIO.output (outfile,goalstr ) |
|
374 |
val _ = TextIO.closeOut outfile*) |
|
375 |
fun killChildren [] = () |
|
376 |
| killChildren (child_handle::children) = (killChild child_handle; killChildren children) |
|
| 15642 | 377 |
|
| 16061 | 378 |
|
379 |
||
380 |
(*************************************************************) |
|
381 |
(* take an instream and poll its underlying reader for input *) |
|
382 |
(*************************************************************) |
|
| 15642 | 383 |
|
| 16061 | 384 |
fun pollParentInput () = |
385 |
||
386 |
let val pd = OS.IO.pollDesc (fromParentIOD) |
|
387 |
in |
|
388 |
if (isSome pd ) then |
|
389 |
let val pd' = OS.IO.pollIn (valOf pd) |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
390 |
val pdl = OS.IO.poll ([pd'], SOME (Time.fromMilliseconds 2000)) |
| 16061 | 391 |
in |
392 |
if null pdl |
|
393 |
then |
|
394 |
NONE |
|
395 |
else if (OS.IO.isIn (hd pdl)) |
|
396 |
then |
|
397 |
(SOME ( getCmds (toParentStr, fromParentStr, []))) |
|
398 |
else |
|
399 |
NONE |
|
400 |
end |
|
401 |
else |
|
402 |
NONE |
|
403 |
end |
|
404 |
||
405 |
||
| 15642 | 406 |
|
| 16061 | 407 |
fun pollChildInput (fromStr) = |
408 |
let val iod = getInIoDesc fromStr |
|
409 |
in |
|
410 |
if isSome iod |
|
411 |
then |
|
412 |
let val pd = OS.IO.pollDesc (valOf iod) |
|
413 |
in |
|
414 |
if (isSome pd ) then |
|
415 |
let val pd' = OS.IO.pollIn (valOf pd) |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
416 |
val pdl = OS.IO.poll ([pd'], SOME (Time.fromMilliseconds 2000)) |
| 16061 | 417 |
in |
418 |
if null pdl |
|
419 |
then |
|
420 |
NONE |
|
421 |
else if (OS.IO.isIn (hd pdl)) |
|
422 |
then |
|
423 |
SOME (getCmd (TextIO.inputLine fromStr)) |
|
424 |
else |
|
425 |
NONE |
|
426 |
end |
|
427 |
else |
|
428 |
NONE |
|
429 |
end |
|
430 |
else |
|
431 |
NONE |
|
432 |
end |
|
| 15642 | 433 |
|
434 |
||
| 16061 | 435 |
(****************************************************************************) |
436 |
(* Check all vampire processes currently running for output *) |
|
437 |
(****************************************************************************) |
|
438 |
(*********************************) |
|
439 |
fun checkChildren ([], toParentStr) = [] (*** no children to check ********) |
|
440 |
(*********************************) |
|
441 |
| checkChildren ((childProc::otherChildren), toParentStr) = |
|
442 |
let val (childInput,childOutput) = cmdstreamsOf childProc |
|
443 |
val child_handle= cmdchildHandle childProc |
|
444 |
(* childCmd is the .dfg file that the problem is in *) |
|
445 |
val childCmd = fst(snd (cmdchildInfo childProc)) |
|
446 |
(* now get the number of the subgoal from the filename *) |
|
447 |
val sg_num = int_of_string(ReconOrderClauses.get_nth 5 (rev(explode childCmd))) |
|
448 |
val childIncoming = pollChildInput childInput |
|
449 |
val parentID = Posix.ProcEnv.getppid() |
|
450 |
val prover = cmdProver childProc |
|
451 |
val thmstring = cmdThm childProc |
|
452 |
val sign = sign_of_thm thm |
|
453 |
val prems = prems_of thm |
|
454 |
val prems_string = Meson.concat_with_and (map (Sign.string_of_term sign) prems) |
|
| 16100 | 455 |
val _ = warning("subgoals forked to checkChildren: "^prems_string)
|
456 |
val goalstring = cmdGoal childProc |
|
457 |
val _ = File.write (File.tmp_path (Path.basic "child_comms")) |
|
458 |
(prover^thmstring^goalstring^childCmd) |
|
| 16061 | 459 |
in |
460 |
if (isSome childIncoming) |
|
461 |
then |
|
462 |
(* check here for prover label on child*) |
|
| 16100 | 463 |
let val _ = File.write (File.tmp_path (Path.basic "child_incoming")) ("subgoals forked to checkChildren: "^prems_string^prover^thmstring^goalstring^childCmd)
|
| 16061 | 464 |
val childDone = (case prover of |
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
465 |
(* "vampire" => startVampireTransfer(childInput, toParentStr, parentID, childCmd) |*)"spass" => (SpassComm.checkSpassProofFound(childInput, toParentStr, parentID,thmstring,goalstring, childCmd, thm, sg_num,clause_arr, num_of_clauses) ) ) |
| 16061 | 466 |
in |
467 |
if childDone (**********************************************) |
|
468 |
then (* child has found a proof and transferred it *) |
|
469 |
(**********************************************) |
|
| 15642 | 470 |
|
| 16061 | 471 |
(**********************************************) |
472 |
(* Remove this child and go on to check others*) |
|
473 |
(**********************************************) |
|
474 |
( Unix.reap child_handle; |
|
475 |
checkChildren(otherChildren, toParentStr)) |
|
476 |
else |
|
477 |
(**********************************************) |
|
478 |
(* Keep this child and go on to check others *) |
|
479 |
(**********************************************) |
|
| 15642 | 480 |
|
| 16061 | 481 |
(childProc::(checkChildren (otherChildren, toParentStr))) |
482 |
end |
|
483 |
else |
|
| 16100 | 484 |
(File.append (File.tmp_path (Path.basic "child_incoming")) "No child output "; |
485 |
childProc::(checkChildren (otherChildren, toParentStr))) |
|
| 16061 | 486 |
end |
| 15642 | 487 |
|
| 16061 | 488 |
|
489 |
(********************************************************************) |
|
490 |
(* call resolution processes *) |
|
491 |
(* settings should be a list of strings *) |
|
492 |
(* e.g. ["-t 300", "-m 100000"] *) |
|
493 |
(* takes list of (string, string, string list, string)list proclist *) |
|
494 |
(********************************************************************) |
|
| 15642 | 495 |
|
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
496 |
|
| 16061 | 497 |
(*** add subgoal id num to this *) |
498 |
fun execCmds [] procList = procList |
|
499 |
| execCmds ((prover, thmstring,goalstring,proverCmd,settings,file)::cmds) procList = |
|
| 16100 | 500 |
if (prover = "spass") |
501 |
then |
|
502 |
let val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc = (Unix.execute(proverCmd, (["-FullRed=0"]@settings@[file]))) |
|
503 |
val (instr, outstr)=Unix.streamsOf childhandle |
|
504 |
val newProcList = (((CMDPROC{
|
|
505 |
prover = prover, |
|
506 |
cmd = file, |
|
507 |
thmstring = thmstring, |
|
508 |
goalstring = goalstring, |
|
509 |
proc_handle = childhandle, |
|
510 |
instr = instr, |
|
511 |
outstr = outstr })::procList)) |
|
512 |
val _ = File.append (File.tmp_path (Path.basic "exec_child")) ("executing command for goal:"^goalstring^proverCmd^(concat settings)^file)
|
|
513 |
in |
|
514 |
execCmds cmds newProcList |
|
515 |
end |
|
516 |
else |
|
517 |
let val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc = (Unix.execute(proverCmd, (["-FullRed=0"]@settings@[file]))) |
|
518 |
val (instr, outstr)=Unix.streamsOf childhandle |
|
519 |
val newProcList = (((CMDPROC{
|
|
520 |
prover = prover, |
|
521 |
cmd = file, |
|
522 |
thmstring = thmstring, |
|
523 |
goalstring = goalstring, |
|
524 |
proc_handle = childhandle, |
|
525 |
instr = instr, |
|
526 |
outstr = outstr })::procList)) |
|
527 |
in |
|
528 |
execCmds cmds newProcList |
|
529 |
end |
|
| 15642 | 530 |
|
531 |
||
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
532 |
|
| 16061 | 533 |
(****************************************) |
534 |
(* call resolution processes remotely *) |
|
535 |
(* settings should be a list of strings *) |
|
536 |
(* e.g. ["-t 300", "-m 100000"] *) |
|
537 |
(****************************************) |
|
538 |
||
539 |
(* fun execRemoteCmds [] procList = procList |
|
540 |
| execRemoteCmds ((prover, thmstring,goalstring,proverCmd ,settings,file)::cmds) procList = |
|
541 |
let val newProcList = mySshExecuteToList ("/usr/bin/ssh",([prover,thmstring,goalstring,"-t", "shep"]@[proverCmd]@settings@[file]), procList)
|
|
542 |
in |
|
543 |
execRemoteCmds cmds newProcList |
|
544 |
end |
|
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
545 |
*) |
| 15642 | 546 |
|
| 16061 | 547 |
fun printList (outStr, []) = () |
548 |
| printList (outStr, (x::xs)) = (TextIO.output (outStr, x);TextIO.flushOut outStr; printList (outStr,xs)) |
|
| 15642 | 549 |
|
550 |
||
| 16061 | 551 |
(**********************************************) |
552 |
(* Watcher Loop *) |
|
553 |
(**********************************************) |
|
554 |
||
| 15642 | 555 |
|
556 |
||
557 |
||
| 16061 | 558 |
fun keepWatching (toParentStr, fromParentStr,procList) = |
559 |
let fun loop (procList) = |
|
560 |
( |
|
561 |
let val cmdsFromIsa = pollParentInput () |
|
562 |
fun killchildHandler (n:int) = (TextIO.output(toParentStr, "Killing child proof processes!\n"); |
|
563 |
TextIO.flushOut toParentStr; |
|
564 |
killChildren (map (cmdchildHandle) procList); |
|
565 |
()) |
|
566 |
||
567 |
in |
|
568 |
(*Signal.signal (Posix.Signal.usr2, Signal.SIG_HANDLE killchildHandler);*) |
|
569 |
(**********************************) |
|
570 |
if (isSome cmdsFromIsa) then (* deal with input from Isabelle *) |
|
571 |
( (**********************************) |
|
572 |
if (getProofCmd(hd(valOf cmdsFromIsa)) = "Kill children" ) |
|
573 |
then |
|
574 |
( |
|
575 |
let val child_handles = map cmdchildHandle procList |
|
576 |
in |
|
577 |
killChildren child_handles; |
|
578 |
(*Posix.Process.kill(Posix.Process.K_PROC (Posix.ProcEnv.getppid()), Posix.Signal.usr2);*) loop ([]) |
|
579 |
end |
|
580 |
||
581 |
) |
|
582 |
else |
|
583 |
( |
|
584 |
if ((length procList)<10) (********************) |
|
585 |
then (* Execute locally *) |
|
586 |
( (********************) |
|
587 |
let |
|
588 |
val newProcList = execCmds (valOf cmdsFromIsa) procList |
|
589 |
val parentID = Posix.ProcEnv.getppid() |
|
590 |
val newProcList' =checkChildren (newProcList, toParentStr) |
|
591 |
in |
|
592 |
(*Posix.Process.sleep (Time.fromSeconds 1);*) |
|
593 |
loop (newProcList') |
|
594 |
end |
|
595 |
) |
|
596 |
else (*********************************) |
|
597 |
(* Execute remotely *) |
|
598 |
(* (actually not remote for now )*) |
|
599 |
( (*********************************) |
|
600 |
let |
|
601 |
val newProcList = execCmds (valOf cmdsFromIsa) procList |
|
602 |
val parentID = Posix.ProcEnv.getppid() |
|
603 |
val newProcList' =checkChildren (newProcList, toParentStr) |
|
604 |
in |
|
605 |
(*Posix.Process.sleep (Time.fromSeconds 1);*) |
|
606 |
loop (newProcList') |
|
607 |
end |
|
608 |
) |
|
| 15642 | 609 |
|
610 |
||
611 |
||
| 16061 | 612 |
) |
613 |
) (******************************) |
|
614 |
else (* No new input from Isabelle *) |
|
615 |
(******************************) |
|
616 |
( let val newProcList = checkChildren ((procList), toParentStr) |
|
617 |
in |
|
618 |
Posix.Process.sleep (Time.fromSeconds 1); |
|
619 |
loop (newProcList) |
|
620 |
end |
|
621 |
||
622 |
) |
|
623 |
end) |
|
624 |
in |
|
625 |
loop (procList) |
|
626 |
end |
|
627 |
||
628 |
||
629 |
in |
|
630 |
(***************************) |
|
631 |
(*** Sort out pipes ********) |
|
632 |
(***************************) |
|
| 15642 | 633 |
|
| 16061 | 634 |
Posix.IO.close (#outfd p1); |
635 |
Posix.IO.close (#infd p2); |
|
636 |
Posix.IO.dup2{old = oldchildin, new = fromParent};
|
|
637 |
Posix.IO.close oldchildin; |
|
638 |
Posix.IO.dup2{old = oldchildout, new = toParent};
|
|
639 |
Posix.IO.close oldchildout; |
|
| 15642 | 640 |
|
| 16061 | 641 |
(***************************) |
642 |
(* start the watcher loop *) |
|
643 |
(***************************) |
|
644 |
keepWatching (toParentStr, fromParentStr, procList); |
|
| 15642 | 645 |
|
646 |
||
| 16061 | 647 |
(****************************************************************************) |
648 |
(* fake return value - actually want the watcher to loop until killed *) |
|
649 |
(****************************************************************************) |
|
650 |
Posix.Process.wordToPid 0w0 |
|
651 |
||
652 |
end); |
|
653 |
(* end case *) |
|
| 15642 | 654 |
|
655 |
||
| 16061 | 656 |
val _ = TextIO.flushOut TextIO.stdOut |
| 15642 | 657 |
|
| 16061 | 658 |
(*******************************) |
659 |
(*** set watcher going ********) |
|
660 |
(*******************************) |
|
| 15642 | 661 |
|
| 16061 | 662 |
val procList = [] |
663 |
val pid = startWatcher (procList) |
|
664 |
(**************************************************) |
|
665 |
(* communication streams to watcher *) |
|
666 |
(**************************************************) |
|
| 15642 | 667 |
|
| 16061 | 668 |
val instr = openInFD ("_exec_in", #infd p2)
|
669 |
val outstr = openOutFD ("_exec_out", #outfd p1)
|
|
670 |
||
671 |
in |
|
672 |
(*******************************) |
|
673 |
(* close the child-side fds *) |
|
674 |
(*******************************) |
|
675 |
Posix.IO.close (#outfd p2); |
|
676 |
Posix.IO.close (#infd p1); |
|
677 |
(* set the fds close on exec *) |
|
678 |
Posix.IO.setfd (#infd p2, Posix.IO.FD.flags [Posix.IO.FD.cloexec]); |
|
679 |
Posix.IO.setfd (#outfd p1, Posix.IO.FD.flags [Posix.IO.FD.cloexec]); |
|
680 |
||
681 |
(*******************************) |
|
682 |
(* return value *) |
|
683 |
(*******************************) |
|
684 |
PROC{pid = pid,
|
|
685 |
instr = instr, |
|
686 |
outstr = outstr |
|
687 |
} |
|
688 |
end; |
|
| 15642 | 689 |
|
690 |
||
691 |
||
692 |
(**********************************************************) |
|
693 |
(* Start a watcher and set up signal handlers *) |
|
694 |
(**********************************************************) |
|
|
16039
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
695 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
696 |
fun killWatcher pid= Posix.Process.kill(Posix.Process.K_PROC pid, Posix.Signal.kill); |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
697 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
698 |
fun reapWatcher(pid, instr, outstr) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
699 |
let |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
700 |
val u = TextIO.closeIn instr; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
701 |
val u = TextIO.closeOut outstr; |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
702 |
|
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
703 |
val (_, status) = |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
704 |
Posix.Process.waitpid(Posix.Process.W_CHILD pid, []) |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
705 |
in |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
706 |
status |
|
dfe264950511
Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents:
15919
diff
changeset
|
707 |
end |
| 15642 | 708 |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
709 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
710 |
fun createWatcher (thm,clause_arr, ( num_of_clauses:int)) = let val mychild = childInfo (setupWatcher(thm,clause_arr, num_of_clauses)) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
711 |
val streams =snd mychild |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
712 |
val childin = fst streams |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
713 |
val childout = snd streams |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
714 |
val childpid = fst mychild |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
715 |
val sign = sign_of_thm thm |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
716 |
val prems = prems_of thm |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
717 |
val prems_string = Meson.concat_with_and (map (Sign.string_of_term sign) prems) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
718 |
val _ = (warning ("subgoals forked to createWatcher: "^prems_string));
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
719 |
fun vampire_proofHandler (n) = |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
720 |
(Pretty.writeln(Pretty.str ( (concat[(oct_char "360"), (oct_char "377")]))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
721 |
getVampInput childin; Pretty.writeln(Pretty.str (oct_char "361"));() ) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
722 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
723 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
724 |
fun spass_proofHandler (n) = ( |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
725 |
let val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "foo_signal1"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
726 |
val _ = TextIO.output (outfile, ("In signal handler now\n"))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
727 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
728 |
val (reconstr, thmstring, goalstring) = SpassComm.getSpassInput childin |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
729 |
val outfile = TextIO.openAppend(File.sysify_path(File.tmp_path (Path.basic "foo_signal"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
730 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
731 |
val _ = TextIO.output (outfile, ("In signal handler "^reconstr^thmstring^goalstring^"goals_being_watched is: "^(string_of_int (!goals_being_watched))))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
732 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
733 |
in (* if a proof has been found and sent back as a reconstruction proof *) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
734 |
if ( (substring (reconstr, 0,1))= "[") |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
735 |
then |
| 15642 | 736 |
|
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
737 |
( |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
738 |
Pretty.writeln(Pretty.str ( (concat[(oct_char "360"), (oct_char "377")]))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
739 |
Recon_Transfer.apply_res_thm reconstr goalstring; |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
740 |
Pretty.writeln(Pretty.str (oct_char "361")); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
741 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
742 |
goals_being_watched := ((!goals_being_watched) - 1); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
743 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
744 |
if ((!goals_being_watched) = 0) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
745 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
746 |
(let val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "foo_reap_found"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
747 |
val _ = TextIO.output (outfile, ("Reaping a watcher, goals watched is: "^(string_of_int (!goals_being_watched))^"\n"))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
748 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
749 |
in |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
750 |
killWatcher (childpid); reapWatcher (childpid,childin, childout); () |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
751 |
end) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
752 |
else |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
753 |
() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
754 |
) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
755 |
(* if there's no proof, but a message from Spass *) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
756 |
else if ((substring (reconstr, 0,5))= "SPASS") |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
757 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
758 |
( |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
759 |
goals_being_watched := (!goals_being_watched) -1; |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
760 |
Pretty.writeln(Pretty.str ( (concat[(oct_char "360"), (oct_char "377")]))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
761 |
Pretty.writeln(Pretty.str (goalstring^reconstr)); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
762 |
Pretty.writeln(Pretty.str (oct_char "361")); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
763 |
if (!goals_being_watched = 0) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
764 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
765 |
(let val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "foo_reap_comp"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
766 |
val _ = TextIO.output (outfile, ("Reaping a watcher, goals watched is: "^(string_of_int (!goals_being_watched))^"\n"))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
767 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
768 |
in |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
769 |
killWatcher (childpid); reapWatcher (childpid,childin, childout); () |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
770 |
end ) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
771 |
else |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
772 |
() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
773 |
) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
774 |
(* print out a list of rules used from clasimpset*) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
775 |
else if ((substring (reconstr, 0,5))= "Rules") |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
776 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
777 |
( |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
778 |
goals_being_watched := (!goals_being_watched) -1; |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
779 |
Pretty.writeln(Pretty.str ( (concat[(oct_char "360"), (oct_char "377")]))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
780 |
Pretty.writeln(Pretty.str (goalstring^reconstr)); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
781 |
Pretty.writeln(Pretty.str (oct_char "361")); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
782 |
if (!goals_being_watched = 0) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
783 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
784 |
(let val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "foo_reap_comp"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
785 |
val _ = TextIO.output (outfile, ("Reaping a watcher, goals watched is: "^(string_of_int (!goals_being_watched))^"\n"))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
786 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
787 |
in |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
788 |
killWatcher (childpid); reapWatcher (childpid,childin, childout);() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
789 |
end ) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
790 |
else |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
791 |
() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
792 |
) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
793 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
794 |
(* if proof translation failed *) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
795 |
else if ((substring (reconstr, 0,5)) = "Proof") |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
796 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
797 |
( |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
798 |
goals_being_watched := (!goals_being_watched) -1; |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
799 |
Pretty.writeln(Pretty.str ( (concat[(oct_char "360"), (oct_char "377")]))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
800 |
Pretty.writeln(Pretty.str (goalstring^reconstr)); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
801 |
Pretty.writeln(Pretty.str (oct_char "361")); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
802 |
if (!goals_being_watched = 0) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
803 |
then |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
804 |
(let val outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "foo_reap_comp"))); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
805 |
val _ = TextIO.output (outfile, ("Reaping a watcher, goals watched is: "^(string_of_int (!goals_being_watched))^"\n"))
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
806 |
val _ = TextIO.closeOut outfile |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
807 |
in |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
808 |
killWatcher (childpid); reapWatcher (childpid,childin, childout); () |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
809 |
end ) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
810 |
else |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
811 |
() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
812 |
) |
| 15642 | 813 |
|
814 |
||
|
16156
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
815 |
else (* add something here ?*) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
816 |
() |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
817 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
818 |
end) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
819 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
820 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
821 |
|
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
822 |
in IsaSignal.signal (IsaSignal.usr1, IsaSignal.SIG_HANDLE vampire_proofHandler); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
823 |
IsaSignal.signal (IsaSignal.usr2, IsaSignal.SIG_HANDLE spass_proofHandler); |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
824 |
(childin, childout, childpid) |
|
2f6fc19aba1e
Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents:
16100
diff
changeset
|
825 |
|
| 15642 | 826 |
|
| 16100 | 827 |
end |
| 15642 | 828 |
|
829 |
||
830 |
||
831 |
||
832 |
||
833 |
end (* structure Watcher *) |