src/HOL/Tools/ATP/watcher.ML
author wenzelm
Thu, 02 Jun 2005 18:29:52 +0200
changeset 16192 733267a60e32
parent 16185 bb71c91e781e
child 16260 4a1f36eafe17
permissions -rw-r--r--
exists: made non-strict; added forall;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
     6
 *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
     7
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
     8
 (***************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
     9
 (*  The watcher process starts a resolution process when it receives a     *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    10
(*  message from Isabelle                                                  *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    11
(*  Signals Isabelle, puts output of child into pipe to Isabelle,          *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    12
(*  and removes dead processes.  Also possible to kill all the resolution  *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    13
(*  processes currently running.                                           *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    14
(*  Hardwired version of where to pick up the tptp files for the moment    *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    15
(***************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    16
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    17
(*use "Proof_Transfer";
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    20
(*use "/homes/clq20/Jia_Code/TransStartIsar";*)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    21
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    22
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    23
structure Watcher: WATCHER =
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    24
  struct
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    25
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    26
val goals_being_watched = ref 0;
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
    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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   112
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   113
fun sendOutput (outstr,str) = (TextIO.outputSubstr (outstr, (Substring.all str));TextIO.flushOut outstr);
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   114
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   115
(********************************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   116
(*  takes a list of arguments and sends them individually to the watcher process by pipe    *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   117
(********************************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   118
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   119
fun outputArgs (toWatcherStr, []) = ()
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   120
|   outputArgs (toWatcherStr, (x::xs)) = (TextIO.output (toWatcherStr, x); 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   121
                                          TextIO.flushOut toWatcherStr;
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   122
                                         outputArgs (toWatcherStr, xs))
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   123
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   124
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   125
(*    gets individual args from instream and concatenates them into a list      *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   126
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   127
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   128
fun getArgs (fromParentStr, toParentStr,ys) =  let 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   129
                                       val thisLine = TextIO.input fromParentStr
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   130
                                    in
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   131
                                        ((ys@[thisLine]))
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   132
                                    end
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   133
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   134
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   135
(*  Remove the \n character from the end of each filename                       *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   136
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   137
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   138
fun getCmd cmdStr = let val backList = ((rev(explode cmdStr))) 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   139
                    in
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   143
                    end
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   144
                            
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   145
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   146
(*  Send request to Watcher for a vampire to be called for filename in arg      *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   147
(********************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   148
                    
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   151
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   152
(*****************************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   153
(*  Send request to Watcher for multiple provers to be called for filenames in arg      *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   154
(*****************************************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   155
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   156
(* need to modify to send over hyps file too *)
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   157
fun callResProvers (toWatcherStr,  []) =
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   158
      (sendOutput (toWatcherStr, "End of calls\n"); 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   159
       TextIO.flushOut toWatcherStr)
15782
a1863ea9052b Corrected the problem with the ATP directory.
quigley
parents: 15774
diff changeset
   160
|   callResProvers (toWatcherStr,(prover,thmstring,goalstring, proverCmd,settings,clasimpfile, axfile, hypsfile,probfile)::args) =
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   161
      let val dfg_dir = File.tmp_path (Path.basic "dfg"); 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   162
	 (*** need to check here if the directory exists and, if not, create it***)
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   163
	  val _ = File.append (File.tmp_path (Path.basic"thmstring_in_watcher"))                                                                     
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   164
	              (thmstring^"\n goals_watched"^(string_of_int(!goals_being_watched))^"\n")
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   167
	  val wholefile = File.tmp_path (Path.basic ("ax_prob_"^probID))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   176
	  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   177
	  val dfg_path = File.sysify_path dfg_dir;
16185
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   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
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   180
	                     ["-fdfg", "-d " ^ dfg_path, File.sysify_path wholefile]) *)
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   181
        val tptp_home = getenv "TPTP2X_HOME" ^ "/tptp2X"
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   182
       
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   183
        val systemcall = system (tptp_home^" -fdfg -d " ^ dfg_path^" "^( File.sysify_path wholefile))
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   184
        val _ =  warning("systemcall is "^ (string_of_int systemcall))
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   185
	(*val _ = Posix.Process.wait ()*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   186
	(*val _ =Unix.reap exec_tptp2x*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   187
	  val newfile = dfg_path^"/ax_prob"^"_"^(probID)^".dfg"
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   188
 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   189
       in   
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   193
	  (warning("dfg file is: "^newfile));
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   198
 (*sendOutput (toWatcherStr, (prover^"*"^thmstring^"*"^goalstring^"*"^proverCmd^"*"^settings^"*"^"/homes/clq20/IsabelleCVS/isabelle/HOL/Tools/ATP/dfg/mini_p1.dfg"^"\n"));*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   199
	  TextIO.flushOut toWatcherStr;
16185
bb71c91e781e Added time lime (60 secs) to Spass calls.
quigley
parents: 16156
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   206
      end
15782
a1863ea9052b Corrected the problem with the ATP directory.
quigley
parents: 15774
diff changeset
   207
(*
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   208
fun callResProversStr (toWatcherStr,  []) =  "End of calls\n" 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   209
                                     
15782
a1863ea9052b Corrected the problem with the ATP directory.
quigley
parents: 15774
diff changeset
   210
|   callResProversStr (toWatcherStr,(prover,thmstring,goalstring, proverCmd,settings,clasimpfile, axfile, hypsfile, probfile)::args) =
a1863ea9052b Corrected the problem with the ATP directory.
quigley
parents: 15774
diff changeset
   211
                                            ((prover^"*"^thmstring^"*"^goalstring^"*"^proverCmd^"*"^settings^"*"^clasimpfile^"*"^axfile^"*"^hypsfile^"*"^probfile^"\n")
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   212
                                            
15782
a1863ea9052b Corrected the problem with the ATP directory.
quigley
parents: 15774
diff changeset
   213
     *)                                      
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   214
 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   215
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   216
(* Send message to watcher to kill currently running vampires *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   217
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   218
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   219
fun callSlayer (toWatcherStr) = (sendOutput (toWatcherStr, "Kill vampires\n"); 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   220
                            TextIO.flushOut toWatcherStr)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   221
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   222
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   223
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   224
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   225
(* Remove \n token from a vampire goal filename and extract   *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   226
(* prover, proverCmd, settings and file from input string     *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   227
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   228
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   229
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   230
 fun takeUntil ch [] res  = (res, [])
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   231
 |   takeUntil ch (x::xs) res = if   x = ch 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   232
                                then
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   233
                                     (res, xs)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   234
                                else
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   235
                                     takeUntil ch xs (res@[x])
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   236
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   237
 fun getSettings [] settings = settings
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   238
|    getSettings (xs) settings = let val (set, rest ) = takeUntil "%" xs []
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   239
                                 in
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   240
                                     getSettings rest (settings@[(implode set)])
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   241
                                 end
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   242
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   243
fun separateFields str =
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   244
  let val (prover, rest) = takeUntil "*" str []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   245
      val prover = implode prover
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   246
      val (thmstring, rest) =  takeUntil "*" rest []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   247
      val thmstring = implode thmstring
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   248
      val (goalstring, rest) =  takeUntil "*" rest []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   249
      val goalstring = implode goalstring
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   250
      val (proverCmd, rest ) =  takeUntil "*" rest []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   251
      val proverCmd = implode proverCmd
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   252
      
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   253
      val (settings, rest) =  takeUntil "*" rest []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   254
      val settings = getSettings settings []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   255
      val (file, rest) =  takeUntil "*" rest []
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   256
      val file = implode file
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   257
      val _ = File.write (File.tmp_path (Path.basic "sep_comms"))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   258
                (prover^thmstring^goalstring^proverCmd^file) 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   259
  in
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   260
     (prover,thmstring,goalstring, proverCmd, settings, file)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   261
  end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   262
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   263
 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   264
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   265
 fun getCmd cmdStr = let val backList = ((rev(explode cmdStr))) 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   266
                     in
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   267
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   268
                         if (String.isPrefix "\n"  (implode backList )) 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   269
                         then 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   270
                             separateFields ((rev ((tl backList))))
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   271
                         else
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   272
                           (separateFields (explode cmdStr))
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   273
                     end
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   274
                      
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   275
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   276
fun getProofCmd (a,b,c,d,e,f) = d
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   277
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   278
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   279
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   280
(* Get commands from Isabelle                                 *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   281
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   282
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   283
fun getCmds (toParentStr,fromParentStr, cmdList) = 
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   284
       let val thisLine = TextIO.inputLine fromParentStr 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   285
       in
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   286
	  (if (thisLine = "End of calls\n") 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   287
	   then 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   288
	      (cmdList)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   289
	   else if (thisLine = "Kill children\n") 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   290
		then 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   291
		    (   TextIO.output (toParentStr,thisLine ); 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   292
			TextIO.flushOut toParentStr;
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   293
		      (("","","","Kill children",[],"")::cmdList)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   294
		     )
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   295
	      else (let val thisCmd = getCmd (thisLine) (* thisCmd = (prover,thmstring,proverCmd, settings, file)*)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   296
		    in
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   297
		      (*TextIO.output (toParentStr, thisCmd); 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   298
			TextIO.flushOut toParentStr;*)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   299
			getCmds (toParentStr,fromParentStr, (thisCmd::cmdList))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   300
		    end
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   301
		    )
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   302
	    )
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   303
	end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   304
                                    
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   305
                                    
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   306
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   307
(*  Get Io-descriptor for polling of an input stream          *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   308
(**************************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   309
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   310
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   311
fun getInIoDesc someInstr = 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   314
        val ioDesc = 
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   315
	    case rd
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   316
	      of TextPrimIO.RD{ioDesc = SOME iod, ...} =>SOME iod
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   317
	       | _ => NONE
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   318
     in (* since getting the reader will have terminated the stream, we need
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   319
	 * to build a new stream. *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   320
	TextIO.setInstream(someInstr, TextIO.StreamIO.mkInstream(rd, buf));
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   321
	ioDesc
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   322
    end
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   323
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   324
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   325
(*************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   326
(*  Set up a Watcher Process         *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   327
(*************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   328
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   329
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   330
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   331
fun setupWatcher (thm,clause_arr, num_of_clauses) = 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   332
  let
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   333
    (** pipes for communication between parent and watcher **)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   334
    val p1 = Posix.IO.pipe ()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   335
    val p2 = Posix.IO.pipe ()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   336
    fun closep () = (
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   337
	  Posix.IO.close (#outfd p1); 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   338
	  Posix.IO.close (#infd p1);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   339
	  Posix.IO.close (#outfd p2); 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   340
	  Posix.IO.close (#infd p2)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   341
	)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   342
    (***********************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   343
    (****** fork a watcher process and get it set up and going *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   344
    (***********************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   345
    fun startWatcher (procList) =
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   346
	     (case  Posix.Process.fork() (***************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   347
	   of SOME pid =>  pid           (* parent - i.e. main Isabelle process *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   348
					 (***************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   349
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   350
					   (*************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   351
	    | NONE => let                  (* child - i.e. watcher  *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   352
		val oldchildin = #infd p1  (*************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   353
		val fromParent = Posix.FileSys.wordToFD 0w0
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   354
		val oldchildout = #outfd p2
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   355
		val toParent = Posix.FileSys.wordToFD 0w1
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   356
		val fromParentIOD = Posix.FileSys.fdToIOD fromParent
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   357
		val fromParentStr = openInFD ("_exec_in_parent", fromParent)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   358
		val toParentStr = openOutFD ("_exec_out_parent", toParent)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   359
		val sign = sign_of_thm thm
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   360
		val prems = prems_of thm
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   361
		val prems_string =  Meson.concat_with_and (map (Sign.string_of_term sign) prems) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   362
		val _ = (warning ("subgoals forked to startWatcher: "^prems_string));
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   363
	       (* tracing *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   364
	      (*val tenth_ax = fst( Array.sub(clause_arr, 1))  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   365
		val tenth_ax_thms = memo_find_clause (tenth_ax, clause_tab)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   366
		val clause_str = Meson.concat_with_and (map string_of_thm tenth_ax_thms)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   367
		val _ = (warning ("tenth axiom in array in watcher is: "^tenth_ax))         
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   368
		val _ = (warning ("tenth axiom in table in watcher is: "^clause_str))         
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   369
		val _ = (warning ("num_of_clauses in watcher is: "^(string_of_int (num_of_clauses))) )       
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   370
			 *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   371
		(*val goalstr = string_of_thm (the_goal)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   372
		 val  outfile = TextIO.openOut(File.sysify_path(File.tmp_path (Path.basic "goal_in_watcher")));  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   373
		val _ = TextIO.output (outfile,goalstr )
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   374
		val _ =  TextIO.closeOut outfile*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   375
		fun killChildren [] = ()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   376
	     |      killChildren  (child_handle::children) = (killChild child_handle; killChildren children)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   377
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   378
	       
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   379
     
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   380
	      (*************************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   381
	      (* take an instream and poll its underlying reader for input *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   382
	      (*************************************************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   383
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   384
	      fun pollParentInput () = 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   385
		     
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   386
			 let val pd = OS.IO.pollDesc (fromParentIOD)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   387
			 in 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   388
			 if (isSome pd ) then 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   391
			     in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   392
				if null pdl 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   393
				then
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   394
				   NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   395
				else if (OS.IO.isIn (hd pdl)) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   396
				     then
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   397
					(SOME ( getCmds (toParentStr, fromParentStr, [])))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   398
				     else
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   399
					 NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   400
			     end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   401
			   else
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   402
			       NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   403
			   end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   404
		      
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   405
	     
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   406
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   407
	       fun pollChildInput (fromStr) = 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   408
		     let val iod = getInIoDesc fromStr
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   409
		     in 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   410
		     if isSome iod 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   411
		     then 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   412
			 let val pd = OS.IO.pollDesc (valOf iod)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   413
			 in 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   414
			 if (isSome pd ) then 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   417
			     in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   418
				if null pdl 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   419
				then
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   420
				   NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   421
				else if (OS.IO.isIn (hd pdl)) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   422
				     then
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   423
					 SOME (getCmd (TextIO.inputLine fromStr))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   424
				     else
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   425
					 NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   426
			     end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   427
			   else
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   428
			       NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   429
			   end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   430
		       else 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   431
			   NONE
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   432
		      end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   433
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   434
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   435
	     (****************************************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   436
	     (* Check all vampire processes currently running for output                 *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   437
	     (****************************************************************************) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   438
							(*********************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   439
	      fun checkChildren ([], toParentStr) = []  (*** no children to check ********)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   440
							(*********************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   441
	      |   checkChildren ((childProc::otherChildren), toParentStr) = 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   442
		    let val (childInput,childOutput) =  cmdstreamsOf childProc
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   443
			val child_handle= cmdchildHandle childProc
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   444
			(* childCmd is the .dfg file that the problem is in *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   445
			val childCmd = fst(snd (cmdchildInfo childProc))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   446
			(* now get the number of the subgoal from the filename *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   447
			val sg_num = int_of_string(ReconOrderClauses.get_nth 5 (rev(explode childCmd)))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   448
			val childIncoming = pollChildInput childInput
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   449
			val parentID = Posix.ProcEnv.getppid()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   450
			val prover = cmdProver childProc
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   451
			val thmstring = cmdThm childProc
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   452
			val sign = sign_of_thm thm
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   453
			val prems = prems_of thm
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   454
			val prems_string =  Meson.concat_with_and (map (Sign.string_of_term sign) prems) 
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   455
			val _ = warning("subgoals forked to checkChildren: "^prems_string)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   456
			val goalstring = cmdGoal childProc							
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   457
			val _ = File.write (File.tmp_path (Path.basic "child_comms")) 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   458
			           (prover^thmstring^goalstring^childCmd)
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   459
		    in 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   460
		      if (isSome childIncoming) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   461
		      then 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   462
			  (* check here for prover label on child*)
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   463
			  let val _ = File.write (File.tmp_path (Path.basic "child_incoming"))  ("subgoals forked to checkChildren: "^prems_string^prover^thmstring^goalstring^childCmd) 
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   466
			   in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   467
			    if childDone      (**********************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   468
			    then              (* child has found a proof and transferred it *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   469
					      (**********************************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   470
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   471
			       (**********************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   472
			       (* Remove this child and go on to check others*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   473
			       (**********************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   474
			       ( Unix.reap child_handle;
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   475
				 checkChildren(otherChildren, toParentStr))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   476
			    else 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   477
			       (**********************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   478
			       (* Keep this child and go on to check others  *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   479
			       (**********************************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   480
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   481
				 (childProc::(checkChildren (otherChildren, toParentStr)))
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   482
			 end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   483
		       else
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   484
			 (File.append (File.tmp_path (Path.basic "child_incoming")) "No child output ";
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   485
			  childProc::(checkChildren (otherChildren, toParentStr)))
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   486
		    end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   487
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   488
	     
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   489
	  (********************************************************************)                  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   490
	  (* call resolution processes                                        *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   491
	  (* settings should be a list of strings                             *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   492
	  (* e.g. ["-t 300", "-m 100000"]                                     *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   493
	  (* takes list of (string, string, string list, string)list proclist *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   494
	  (********************************************************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   497
(*** add subgoal id num to this *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   498
	     fun execCmds  [] procList = procList
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   499
	     |   execCmds  ((prover, thmstring,goalstring,proverCmd,settings,file)::cmds) procList  = 
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   500
		   if (prover = "spass") 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   501
		   then 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   502
		       let val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc  = (Unix.execute(proverCmd, (["-FullRed=0"]@settings@[file])))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   503
			   val (instr, outstr)=Unix.streamsOf childhandle
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   504
			   val newProcList =    (((CMDPROC{
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   505
						prover = prover,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   506
						cmd = file,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   507
						thmstring = thmstring,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   508
						goalstring = goalstring,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   509
						proc_handle = childhandle,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   510
						instr = instr,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   511
						outstr = outstr })::procList))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   512
			    val _ = File.append (File.tmp_path (Path.basic "exec_child"))  ("executing command for goal:"^goalstring^proverCmd^(concat settings)^file)
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   513
		       in
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   514
			  execCmds cmds newProcList
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   515
		       end
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   516
		   else 
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   517
		       let val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc  = (Unix.execute(proverCmd, (["-FullRed=0"]@settings@[file])))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   518
			   val (instr, outstr)=Unix.streamsOf childhandle
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   519
			   val newProcList =    (((CMDPROC{
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   520
						prover = prover,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   521
						cmd = file,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   522
						thmstring = thmstring,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   523
						goalstring = goalstring,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   524
						proc_handle = childhandle,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   525
						instr = instr,
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   526
						outstr = outstr })::procList))
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   527
		       in
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   528
			  execCmds cmds newProcList
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   529
		       end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   530
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   533
	  (****************************************)                  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   534
	  (* call resolution processes remotely   *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   535
	  (* settings should be a list of strings *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   536
	  (* e.g. ["-t 300", "-m 100000"]         *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   537
	  (****************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   538
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   539
	   (*  fun execRemoteCmds  [] procList = procList
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   540
	     |   execRemoteCmds ((prover, thmstring,goalstring,proverCmd ,settings,file)::cmds) procList  =  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   541
				       let val  newProcList =  mySshExecuteToList ("/usr/bin/ssh",([prover,thmstring,goalstring,"-t", "shep"]@[proverCmd]@settings@[file]), procList)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   542
					   in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   543
						execRemoteCmds  cmds newProcList
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   546
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   547
	     fun printList (outStr, []) = ()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   548
	     |   printList (outStr, (x::xs)) = (TextIO.output (outStr, x);TextIO.flushOut outStr; printList (outStr,xs))                  
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   549
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   550
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   551
	  (**********************************************)                  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   552
	  (* Watcher Loop                               *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   553
	  (**********************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   554
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   555
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   556
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   557
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   558
	      fun keepWatching (toParentStr, fromParentStr,procList) = 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   559
		    let    fun loop (procList) =  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   560
			   (
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   561
			   let val cmdsFromIsa = pollParentInput ()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   562
			       fun killchildHandler (n:int)  = (TextIO.output(toParentStr, "Killing child proof processes!\n");
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   563
					    TextIO.flushOut toParentStr;
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   564
					     killChildren (map (cmdchildHandle) procList);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   565
					      ())
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   566
			       
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   567
			   in 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   568
			      (*Signal.signal (Posix.Signal.usr2, Signal.SIG_HANDLE killchildHandler);*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   569
										 (**********************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   570
			      if (isSome cmdsFromIsa) then                       (*  deal with input from Isabelle *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   571
				   (                                             (**********************************)                             
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   572
				    if (getProofCmd(hd(valOf cmdsFromIsa)) = "Kill children" )
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   573
				    then 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   574
				      (
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   575
					let val child_handles = map cmdchildHandle procList 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   576
					in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   577
					   killChildren child_handles;
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   578
					   (*Posix.Process.kill(Posix.Process.K_PROC (Posix.ProcEnv.getppid()), Posix.Signal.usr2);*)                                                              loop ([])
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   579
					end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   580
					   
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   581
				       )
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   582
				    else
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   583
				      ( 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   584
					if ((length procList)<10)    (********************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   585
					then                        (* Execute locally  *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   586
					   (                        (********************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   587
					    let 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   588
					      val newProcList = execCmds (valOf cmdsFromIsa) procList
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   589
					      val parentID = Posix.ProcEnv.getppid()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   590
					      val newProcList' =checkChildren (newProcList, toParentStr) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   591
					    in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   592
					      (*Posix.Process.sleep (Time.fromSeconds 1);*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   593
					      loop (newProcList') 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   594
					    end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   595
					    )
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   596
					else                         (*********************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   597
								     (* Execute remotely              *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   598
								     (* (actually not remote for now )*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   599
					    (                        (*********************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   600
					    let 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   601
					      val newProcList = execCmds (valOf cmdsFromIsa) procList
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   602
					      val parentID = Posix.ProcEnv.getppid()
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   603
					      val newProcList' =checkChildren (newProcList, toParentStr) 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   604
					    in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   605
					      (*Posix.Process.sleep (Time.fromSeconds 1);*)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   606
					      loop (newProcList') 
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   607
					    end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   608
					    )
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   609
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   610
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   611
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   612
					)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   613
				     )                                              (******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   614
			      else                                                  (* No new input from Isabelle *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   615
										    (******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   616
				  (    let val newProcList = checkChildren ((procList), toParentStr)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   617
				       in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   618
					 Posix.Process.sleep (Time.fromSeconds 1);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   619
					 loop (newProcList)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   620
				       end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   621
				   
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   622
				   )
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   623
			    end)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   624
		    in  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   625
			loop (procList)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   626
		    end
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   627
		
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   628
    
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   629
		in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   630
		 (***************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   631
		 (*** Sort out pipes ********)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   632
		 (***************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   633
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   634
		  Posix.IO.close (#outfd p1);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   635
		  Posix.IO.close (#infd p2);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   636
		  Posix.IO.dup2{old = oldchildin, new = fromParent};
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   637
		  Posix.IO.close oldchildin;
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   638
		  Posix.IO.dup2{old = oldchildout, new = toParent};
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   639
		  Posix.IO.close oldchildout;
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   640
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   641
		  (***************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   642
		  (* start the watcher loop  *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   643
		  (***************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   644
		  keepWatching (toParentStr, fromParentStr, procList);
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   645
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   646
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   647
		  (****************************************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   648
		  (* fake return value - actually want the watcher to loop until killed       *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   649
		  (****************************************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   650
		  Posix.Process.wordToPid 0w0
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   651
		  
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   652
		end);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   653
	  (* end case *)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   654
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   655
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   656
    val _ = TextIO.flushOut TextIO.stdOut
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   657
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   658
    (*******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   659
    (***  set watcher going ********)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   660
    (*******************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   661
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   662
    val procList = []
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   663
    val pid = startWatcher (procList)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   664
    (**************************************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   665
    (* communication streams to watcher               *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   666
    (**************************************************)
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   667
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   668
    val instr = openInFD ("_exec_in", #infd p2)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   669
    val outstr = openOutFD ("_exec_out", #outfd p1)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   670
    
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   671
    in
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   672
     (*******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   673
     (* close the child-side fds    *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   674
     (*******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   675
      Posix.IO.close (#outfd p2);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   676
      Posix.IO.close (#infd p1);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   677
      (* set the fds close on exec *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   678
      Posix.IO.setfd (#infd p2, Posix.IO.FD.flags [Posix.IO.FD.cloexec]);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   679
      Posix.IO.setfd (#outfd p1, Posix.IO.FD.flags [Posix.IO.FD.cloexec]);
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   680
       
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   681
     (*******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   682
     (* return value                *)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   683
     (*******************************)
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   684
      PROC{pid = pid,
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   685
	instr = instr,
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   686
	outstr = outstr
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   687
      }
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   688
   end;
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   689
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   690
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   691
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   692
(**********************************************************)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   693
(* Start a watcher and set up signal handlers             *)
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   813
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   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
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   826
16100
f80fc4bff933 Now uses File.write and File.append
paulson
parents: 16091
diff changeset
   827
  end
15642
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   828
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   829
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   830
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   831
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   832
028059faa963 *** empty log message ***
quigley
parents:
diff changeset
   833
end (* structure Watcher *)