src/HOL/Tools/ATP/watcher.ML
changeset 19449 b07e3bca20c9
parent 19239 31c114337224
child 20416 f9cb300118ca
equal deleted inserted replaced
19448:72dab71cb11e 19449:b07e3bca20c9
   193   case String.tokens (not o Char.isDigit) s of
   193   case String.tokens (not o Char.isDigit) s of
   194       [] => (trace ("\nWatcher could not read subgoal nunber! " ^ s); 
   194       [] => (trace ("\nWatcher could not read subgoal nunber! " ^ s); 
   195              error "")
   195              error "")
   196     | numbers => valOf (Int.fromString (List.last numbers));
   196     | numbers => valOf (Int.fromString (List.last numbers));
   197 
   197 
   198 (* call ATP.  Settings should be a list of strings  ["-t300", "-m100000"]*)
   198 (*Call ATP.  Settings should be a list of strings  ["-t 300", "-m 100000"],
       
   199   which we convert below to ["-t", "300", "-m", "100000"] using String.tokens.
       
   200   Otherwise, the SML/NJ version of Unix.execute will escape the spaces, and
       
   201   Vampire will reject the switches.*)
   199 fun execCmds [] procList = procList
   202 fun execCmds [] procList = procList
   200   | execCmds ((prover,proverCmd,settings,file)::cmds) procList  =
   203   | execCmds ((prover,proverCmd,settings,file)::cmds) procList  =
   201       let val _ = trace ("\nAbout to execute command: " ^ proverCmd ^ " " ^ file)
   204       let val _ = trace ("\nAbout to execute command: " ^ proverCmd ^ " " ^ file)
       
   205           val settings' = List.concat (map (String.tokens Char.isSpace) settings)
   202 	  val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc  = 
   206 	  val childhandle:(TextIO.instream,TextIO.outstream) Unix.proc  = 
   203 	       Unix.execute(proverCmd, settings@[file])
   207 	       Unix.execute(proverCmd, settings' @ [file])
   204 	  val (instr, outstr) = Unix.streamsOf childhandle
   208 	  val (instr, outstr) = Unix.streamsOf childhandle
   205 	  val newProcList = {prover=prover, file=file, proc_handle=childhandle,
   209 	  val newProcList = {prover=prover, file=file, proc_handle=childhandle,
   206 			     instr=instr, outstr=outstr} :: procList
   210 			     instr=instr, outstr=outstr} :: procList
   207 	  val _ = trace ("\nFinished at " ^
   211 	  val _ = trace ("\nFinished at " ^
   208 			 Date.toString(Date.fromTimeLocal(Time.now())))
   212 			 Date.toString(Date.fromTimeLocal(Time.now())))