src/HOL/Tools/res_atp.ML
author quigley
Mon Jul 04 15:51:56 2005 +0200 (2005-07-04)
changeset 16675 96bdc59afc05
parent 16520 7a9cda53bfa2
child 16741 7a6c17b826c0
permissions -rw-r--r--
Streamlined the signal handler in watcher.ML
paulson@15608
     1
(*  Author: Jia Meng, Cambridge University Computer Laboratory
quigley@16520
     2
paulson@15608
     3
    ID: $Id$
quigley@16520
     4
paulson@15608
     5
    Copyright 2004 University of Cambridge
paulson@15347
     6
paulson@15347
     7
ATPs with TPTP format input.
paulson@15347
     8
*)
paulson@15452
     9
paulson@15452
    10
(*Jia: changed: isar_atp now processes entire proof context.  fetch thms from delta simpset/claset*)
quigley@15644
    11
(*Claire: changed: added actual watcher calls *)
paulson@15452
    12
quigley@15779
    13
paulson@15347
    14
signature RES_ATP = 
quigley@16478
    15
sig  
paulson@15608
    16
val trace_res : bool ref
quigley@15779
    17
val subgoals: Thm.thm list
quigley@15779
    18
val traceflag : bool ref
paulson@15608
    19
val axiom_file : Path.T
paulson@15608
    20
val hyps_file : Path.T
paulson@15608
    21
val isar_atp : ProofContext.context * Thm.thm -> unit
quigley@15657
    22
val prob_file : Path.T;
quigley@15644
    23
(*val atp_ax_tac : Thm.thm list -> int -> Tactical.tactic*)
quigley@15644
    24
(*val atp_tac : int -> Tactical.tactic*)
paulson@15608
    25
val debug: bool ref
quigley@16156
    26
val full_spass: bool ref
quigley@16478
    27
(*val spass: bool ref*)
quigley@16478
    28
val vampire: bool ref
quigley@16520
    29
val custom_spass :string list  ref
paulson@15347
    30
end;
paulson@15347
    31
paulson@15347
    32
structure ResAtp : RES_ATP =
paulson@15608
    33
paulson@15347
    34
struct
paulson@15347
    35
quigley@15779
    36
val subgoals = [];
quigley@15644
    37
quigley@15779
    38
val traceflag = ref true;
quigley@16357
    39
(* used for debug *)
quigley@16357
    40
val debug = ref false;
paulson@16172
    41
paulson@15608
    42
fun debug_tac tac = (warning "testing";tac);
quigley@16357
    43
(* default value is false *)
quigley@16478
    44
quigley@16357
    45
val full_spass = ref false;
quigley@16478
    46
quigley@16478
    47
(* use spass as default prover *)
quigley@16478
    48
(*val spass = ref true;*)
quigley@16478
    49
quigley@16520
    50
val custom_spass = ref ["Auto=0","-IORe","-IOFc","-RTaut","-RFSub","-RBSub","-DocProof","-TimeLimit=60"];
quigley@16478
    51
val vampire = ref false;
quigley@16478
    52
paulson@15608
    53
val trace_res = ref false;
paulson@15347
    54
paulson@15608
    55
val skolem_tac = skolemize_tac;
paulson@15608
    56
quigley@15644
    57
val num_of_clauses = ref 0;
quigley@15644
    58
val clause_arr = Array.array(3500, ("empty", 0));
quigley@15644
    59
paulson@15347
    60
paulson@15608
    61
val atomize_tac =
paulson@15608
    62
    SUBGOAL
paulson@15608
    63
     (fn (prop,_) =>
paulson@15608
    64
	 let val ts = Logic.strip_assums_hyp prop
paulson@15608
    65
	 in EVERY1 
paulson@15608
    66
		[METAHYPS
paulson@15608
    67
		     (fn hyps => (cut_facts_tac (map (ObjectLogic.atomize_thm o forall_intr_vars) hyps) 1)),
paulson@15608
    68
	  REPEAT_DETERM_N (length ts) o (etac thin_rl)]
paulson@15608
    69
     end);
paulson@15347
    70
paulson@15608
    71
(* temporarily use these files, which will be loaded by Vampire *)
quigley@15644
    72
val file_id_num =ref 0;
paulson@15608
    73
quigley@15644
    74
fun new_prob_file () =  (file_id_num := (!file_id_num) + 1;"prob"^(string_of_int (!file_id_num)));
paulson@15608
    75
paulson@15347
    76
quigley@15644
    77
val axiom_file = File.tmp_path (Path.basic "axioms");
quigley@15644
    78
val clasimp_file = File.tmp_path (Path.basic "clasimp");
quigley@15644
    79
val hyps_file = File.tmp_path (Path.basic "hyps");
quigley@15644
    80
val prob_file = File.tmp_path (Path.basic "prob");
quigley@15644
    81
val dummy_tac = PRIMITIVE(fn thm => thm );
quigley@15644
    82
quigley@15644
    83
 
paulson@15347
    84
(**** for Isabelle/ML interface  ****)
paulson@15347
    85
quigley@16357
    86
fun is_proof_char ch = ((33 <= (ord ch)) andalso ((ord ch ) <= 126) andalso (not ((ord ch ) = 63))) orelse (ch = " ")
paulson@15608
    87
quigley@16357
    88
fun proofstring x = let val exp = explode x 
quigley@16357
    89
                    in
quigley@16357
    90
                        List.filter (is_proof_char ) exp
quigley@16357
    91
                    end
quigley@16357
    92
paulson@15608
    93
paulson@15452
    94
quigley@15644
    95
(*
quigley@15644
    96
fun call_atp_tac thms n = (tptp_inputs thms ; dummy_tac);
paulson@15347
    97
quigley@15644
    98
*)
paulson@15347
    99
paulson@15347
   100
(**** For running in Isar ****)
paulson@15347
   101
paulson@15608
   102
(* same function as that in res_axioms.ML *)
paulson@15608
   103
fun repeat_RS thm1 thm2 =
paulson@15608
   104
    let val thm1' =  thm1 RS thm2 handle THM _ => thm1
paulson@15608
   105
    in
paulson@15608
   106
	if eq_thm(thm1,thm1') then thm1' else (repeat_RS thm1' thm2)
paulson@15608
   107
    end;
paulson@15608
   108
paulson@15608
   109
(* a special version of repeat_RS *)
paulson@15608
   110
fun repeat_someI_ex thm = repeat_RS thm someI_ex;
paulson@15608
   111
quigley@15644
   112
(*********************************************************************)
paulson@15608
   113
(* convert clauses from "assume" to conjecture. write to file "hyps" *)
quigley@15644
   114
(* hypotheses of the goal currently being proved                     *)
quigley@15644
   115
(*********************************************************************)
quigley@15644
   116
paulson@15608
   117
fun isar_atp_h thms =
quigley@15644
   118
        
paulson@15608
   119
    let val prems = map (skolemize o make_nnf o ObjectLogic.atomize_thm) thms
quigley@15644
   120
        val prems' = map repeat_someI_ex prems
quigley@15644
   121
        val prems'' = make_clauses prems'
quigley@15644
   122
        val prems''' = ResAxioms.rm_Eps [] prems''
quigley@15644
   123
        val clss = map ResClause.make_conjecture_clause prems'''
paulson@15774
   124
	val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss) 
paulson@15608
   125
	val tfree_lits = ResLib.flat_noDup tfree_litss
paulson@15608
   126
	val tfree_clss = map ResClause.tfree_clause tfree_lits 
wenzelm@16259
   127
        val hypsfile = File.platform_path hyps_file
paulson@15608
   128
	val out = TextIO.openOut(hypsfile)
paulson@15608
   129
    in
paulson@15608
   130
	((ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; if !trace_res then (warning hypsfile) else ());tfree_lits) 
paulson@15608
   131
    end;
paulson@15347
   132
quigley@15644
   133
quigley@15644
   134
(*********************************************************************)
quigley@15644
   135
(* write out a subgoal as tptp clauses to the file "probN"           *)
quigley@15644
   136
(* where N is the number of this subgoal                             *)
quigley@15644
   137
(*********************************************************************)
quigley@15644
   138
paulson@15608
   139
fun tptp_inputs_tfrees thms n tfrees = 
quigley@15657
   140
    let val _ = (warning ("in tptp_inputs_tfrees 0"))
quigley@15657
   141
        val clss = map (ResClause.make_conjecture_clause_thm) thms
quigley@15657
   142
         val _ = (warning ("in tptp_inputs_tfrees 1"))
paulson@15774
   143
	val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss)
quigley@15657
   144
        val _ = (warning ("in tptp_inputs_tfrees 2"))
paulson@15608
   145
	val tfree_clss = map ResClause.tfree_clause ((ResLib.flat_noDup tfree_litss) \\ tfrees) 
quigley@15657
   146
         val _ = (warning ("in tptp_inputs_tfrees 3"))
wenzelm@16259
   147
        val probfile = (File.platform_path prob_file) ^ "_" ^ (string_of_int n)
paulson@15608
   148
	val out = TextIO.openOut(probfile)
paulson@15608
   149
    in
quigley@16357
   150
	(ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; (if !trace_res then (warning probfile) else ()))
paulson@15608
   151
    end;
paulson@15452
   152
paulson@15608
   153
quigley@16357
   154
quigley@15644
   155
(*********************************************************************)
quigley@15644
   156
(* call SPASS with settings and problem file for the current subgoal *)
quigley@15644
   157
(* should be modified to allow other provers to be called            *)
quigley@15644
   158
(*********************************************************************)
quigley@16357
   159
(* now passing in list of skolemized thms and list of sgterms to go with them *)
paulson@16515
   160
fun call_resolve_tac  (thms: Thm.thm list list)  sign (sg_terms:  Term.term list) (childin, childout,pid) n  = 
paulson@16515
   161
 let
quigley@16357
   162
   val axfile = (File.platform_path axiom_file)
quigley@16520
   163
quigley@16520
   164
    val hypsfile = (File.platform_path hyps_file)
quigley@16520
   165
     val clasimpfile = (File.platform_path clasimp_file)
quigley@16520
   166
    val spass_home = getenv "SPASS_HOME"
quigley@16520
   167
quigley@16520
   168
paulson@16475
   169
   fun make_atp_list [] sign n = []
paulson@16475
   170
   |   make_atp_list ((sko_thm, sg_term)::xs) sign  n = 
paulson@16515
   171
     let 
quigley@16520
   172
quigley@16357
   173
	val skothmstr = Meson.concat_with_and (map string_of_thm sko_thm) 
quigley@16357
   174
	val thmproofstr = proofstring ( skothmstr)
quigley@16357
   175
	val no_returns =List.filter   not_newline ( thmproofstr)
quigley@16357
   176
	val thmstr = implode no_returns
quigley@16357
   177
	val _ = warning ("thmstring in make_atp_lists is: "^thmstr)
paulson@15608
   178
quigley@16357
   179
	val sgstr = Sign.string_of_term sign sg_term 
quigley@16357
   180
	val goalproofstring = proofstring sgstr
paulson@16089
   181
	val no_returns =List.filter not_newline ( goalproofstring)
paulson@16089
   182
	val goalstring = implode no_returns
quigley@16357
   183
	val _ = warning ("goalstring in make_atp_lists is: "^goalstring)
quigley@16357
   184
wenzelm@16259
   185
	val probfile = (File.platform_path prob_file) ^ "_" ^ (string_of_int n)
quigley@16520
   186
paulson@16515
   187
	val _ = (warning ("prob file in cal_res_tac is: "^probfile))      
paulson@16515
   188
     in
paulson@16515
   189
       if !SpassComm.spass 
paulson@16515
   190
       then 
paulson@16515
   191
         let val _ = ResLib.helper_path "SPASS_HOME" "SPASS"
paulson@16515
   192
         in  (*We've checked that SPASS is there for ATP/spassshell to run.*)
paulson@16515
   193
           if !full_spass 
paulson@16515
   194
            then (*Allow SPASS to run in Auto mode, using all its inference rules*)
quigley@16520
   195
quigley@16357
   196
   		([("spass", thmstr, goalstring (*,spass_home*), 
quigley@16520
   197
quigley@16520
   198
	    	 getenv "ISABELLE_HOME" ^ "/src/HOL/Tools/ATP/spassshell"(*( getenv "SPASS_HOME")^"/SPASS"*),  
quigley@16520
   199
	     	"-DocProof%-TimeLimit=60%-SOS", 
quigley@16520
   200
quigley@16357
   201
	     	clasimpfile, axfile, hypsfile, probfile)]@(make_atp_list xs sign (n+1)))
paulson@16515
   202
  	    else (*Restrict SPASS to a small set of rules that we can parse*)
quigley@16357
   203
   		([("spass", thmstr, goalstring (*,spass_home*), 
quigley@16357
   204
	     	getenv "ISABELLE_HOME" ^"/src/HOL/Tools/ATP/spassshell"(* (getenv "SPASS_HOME")^"/SPASS"*),  
quigley@16520
   205
	     	("-" ^ space_implode "%-" (!custom_spass)), 
quigley@16478
   206
	     	clasimpfile, axfile, hypsfile, probfile)]@(make_atp_list xs sign (n+1)))
paulson@16515
   207
	 end
quigley@16478
   208
     else
paulson@16515
   209
       let val vampire = ResLib.helper_path "VAMPIRE_HOME" "vkernel"
paulson@16515
   210
       in  
quigley@16675
   211
	   ([("vampire", thmstr, goalstring, vampire, "-t 60%-m 100000", 
paulson@16515
   212
	      clasimpfile, axfile, hypsfile, probfile)] @ 
paulson@16515
   213
	    (make_atp_list xs sign (n+1)))
paulson@16515
   214
       end
paulson@16515
   215
     end
paulson@15452
   216
quigley@16357
   217
val thms_goals = ListPair.zip( thms, sg_terms) 
quigley@16357
   218
val atp_list = make_atp_list  thms_goals sign 1
quigley@16357
   219
in
quigley@16357
   220
	Watcher.callResProvers(childout,atp_list);
quigley@16357
   221
        warning("Sent commands to watcher!");
quigley@16357
   222
  	dummy_tac
quigley@16357
   223
 end
quigley@16357
   224
quigley@15644
   225
(**********************************************************)
quigley@15644
   226
(* write out the current subgoal as a tptp file, probN,   *)
quigley@15644
   227
(* then call dummy_tac - should be call_res_tac           *)
quigley@15644
   228
(**********************************************************)
quigley@15679
   229
quigley@15657
   230
quigley@16357
   231
fun get_sko_thms tfrees sign sg_terms (childin, childout,pid)  thm n sko_thms  =
paulson@16515
   232
    if n=0 then 
paulson@16515
   233
	     (call_resolve_tac  (rev sko_thms) sign  sg_terms (childin, childout, pid) (List.length sg_terms);dummy_tac thm)
paulson@16515
   234
     else
paulson@16515
   235
	
paulson@16515
   236
     ( SELECT_GOAL
paulson@16515
   237
	     (EVERY1 [rtac ccontr,atomize_tac, skolemize_tac, 
paulson@16515
   238
	      METAHYPS(fn negs => (tptp_inputs_tfrees (make_clauses negs) n tfrees;
paulson@16515
   239
				 get_sko_thms  tfrees sign sg_terms (childin, childout, pid) thm  (n -1) (negs::sko_thms);dummy_tac))]) n thm )
quigley@15644
   240
quigley@15644
   241
quigley@15644
   242
quigley@15644
   243
(**********************************************)
quigley@15644
   244
(* recursively call atp_tac_g on all subgoals *)
quigley@15644
   245
(* sg_term is the nth subgoal as a term - used*)
quigley@15644
   246
(* in proof reconstruction                    *)
quigley@15644
   247
(**********************************************)
quigley@15644
   248
quigley@16357
   249
fun isar_atp_goal' thm n tfree_lits  (childin, childout, pid) = 
paulson@16515
   250
    let val  prems = prems_of thm 
paulson@16515
   251
      (*val sg_term = get_nth k prems*)
paulson@16515
   252
	val sign = sign_of_thm thm
paulson@16515
   253
	val thmstring = string_of_thm thm
paulson@16515
   254
    in   
paulson@16515
   255
	warning("in isar_atp_goal'");
paulson@16515
   256
	warning("thmstring in isar_atp_goal': "^thmstring);
paulson@16515
   257
	(* go and call callResProvers with this subgoal *)
paulson@16515
   258
	(* isar_atp_g tfree_lits  sg_term (childin, childout, pid) k thm; *)
paulson@16515
   259
	(* recursive call to pick up the remaining subgoals *)
paulson@16515
   260
	(* isar_atp_goal' thm (k+1) n tfree_lits  (childin, childout, pid) *)
paulson@16515
   261
	get_sko_thms tfree_lits sign  prems (childin, childout, pid) thm n []
paulson@16515
   262
    end ;
quigley@15644
   263
quigley@16520
   264
quigley@15644
   265
quigley@15644
   266
(**************************************************)
quigley@15644
   267
(* convert clauses from "assume" to conjecture.   *)
quigley@15644
   268
(* i.e. apply make_clauses and then get tptp for  *)
quigley@15679
   269
(* any hypotheses in the goal produced by assume  *)
quigley@15679
   270
(* statements;                                    *)
quigley@15644
   271
(* write to file "hyps"                           *)
quigley@15644
   272
(**************************************************)
quigley@15644
   273
quigley@15644
   274
quigley@15644
   275
fun isar_atp_aux thms thm n_subgoals  (childin, childout, pid) = 
paulson@15608
   276
    let val tfree_lits = isar_atp_h thms 
quigley@16357
   277
    in
quigley@16357
   278
	(warning("in isar_atp_aux"));
quigley@16357
   279
         isar_atp_goal' thm n_subgoals tfree_lits   (childin, childout, pid)
paulson@15608
   280
    end;
quigley@15644
   281
quigley@15644
   282
(******************************************************************)
quigley@15644
   283
(* called in Isar automatically                                   *)
quigley@15644
   284
(* writes out the current clasimpset to a tptp file               *)
quigley@15644
   285
(* passes all subgoals on to isar_atp_aux for further processing  *)
quigley@15644
   286
(* turns off xsymbol at start of function, restoring it at end    *)
quigley@15644
   287
(******************************************************************)
quigley@15779
   288
(*FIX changed to clasimp_file *)
quigley@16357
   289
fun isar_atp' (ctxt,thms, thm) =
quigley@16357
   290
    let 
quigley@16357
   291
	val _=  (print_mode := (Library.gen_rems (op =) (! print_mode, ["xsymbols", "symbols"])))
quigley@15644
   292
        val _= (warning ("in isar_atp'"))
quigley@15779
   293
        val prems  = prems_of thm
paulson@15697
   294
        val sign = sign_of_thm thm
quigley@15779
   295
        val thms_string = Meson.concat_with_and (map string_of_thm thms) 
quigley@15644
   296
        val thmstring = string_of_thm thm
quigley@15779
   297
        val prems_string = Meson.concat_with_and (map (Sign.string_of_term sign) prems) 
quigley@15919
   298
        
quigley@15919
   299
	(* set up variables for writing out the clasimps to a tptp file *)
paulson@16172
   300
	val (clause_arr, num_of_clauses) =
quigley@16357
   301
	    ResClasimp.write_out_clasimp(*_small*) (File.platform_path clasimp_file) 
paulson@16172
   302
	                                 (ProofContext.theory_of ctxt)
quigley@16357
   303
        val _ = (warning ("clasimp_file is this: "^(File.platform_path clasimp_file)) )  
quigley@16520
   304
           
quigley@15919
   305
        
quigley@15919
   306
        val (childin,childout,pid) = Watcher.createWatcher(thm,clause_arr, num_of_clauses)
quigley@15644
   307
        val pidstring = string_of_int(Word.toInt (Word.fromLargeWord ( Posix.Process.pidToWord pid )))
paulson@15608
   308
    in
quigley@15644
   309
	case prems of [] => () 
quigley@15644
   310
		    | _ => ((warning ("initial thms: "^thms_string)); 
quigley@15644
   311
                           (warning ("initial thm: "^thmstring));
quigley@15644
   312
                           (warning ("subgoals: "^prems_string));
quigley@15644
   313
                           (warning ("pid: "^ pidstring))); 
quigley@15644
   314
                            isar_atp_aux thms thm (length prems) (childin, childout, pid) ;
quigley@16357
   315
                           (warning("turning xsymbol back on!"));
quigley@15644
   316
                           print_mode := (["xsymbols", "symbols"] @ ! print_mode)
paulson@15608
   317
    end;
paulson@15608
   318
paulson@15452
   319
paulson@15608
   320
paulson@15608
   321
paulson@15608
   322
local
paulson@15608
   323
paulson@15608
   324
fun get_thms_cs claset =
paulson@15608
   325
    let val clsset = rep_cs claset
paulson@15608
   326
	val safeEs = #safeEs clsset
paulson@15608
   327
	val safeIs = #safeIs clsset
paulson@15608
   328
	val hazEs = #hazEs clsset
paulson@15608
   329
	val hazIs = #hazIs clsset
paulson@15608
   330
    in
paulson@15608
   331
	safeEs @ safeIs @ hazEs @ hazIs
paulson@15608
   332
    end;
paulson@15608
   333
quigley@16357
   334
quigley@16357
   335
paulson@15608
   336
fun append_name name [] _ = []
paulson@15608
   337
  | append_name name (thm::thms) k = (Thm.name_thm ((name ^ "_" ^ (string_of_int k)),thm)) :: (append_name name thms (k+1));
paulson@15608
   338
paulson@15608
   339
fun append_names (name::names) (thms::thmss) =
paulson@15608
   340
    let val thms' = append_name name thms 0
paulson@15608
   341
    in
paulson@15608
   342
	thms'::(append_names names thmss)
paulson@15608
   343
    end;
paulson@15608
   344
quigley@16357
   345
paulson@15608
   346
fun get_thms_ss [] = []
paulson@15608
   347
  | get_thms_ss thms =
paulson@15608
   348
    let val names = map Thm.name_of_thm thms 
paulson@15608
   349
        val thms' = map (mksimps mksimps_pairs) thms
paulson@15608
   350
        val thms'' = append_names names thms'
paulson@15608
   351
    in
paulson@15608
   352
	ResLib.flat_noDup thms''
paulson@15608
   353
    end;
paulson@15608
   354
quigley@16357
   355
quigley@16357
   356
quigley@16357
   357
paulson@15608
   358
in
paulson@15608
   359
paulson@15452
   360
paulson@15608
   361
(* convert locally declared rules to axiom clauses *)
paulson@15608
   362
(* write axiom clauses to ax_file *)
quigley@15644
   363
(* what about clasimpset - it should already be in the ax file - perhaps append to ax file rather than just *)
quigley@15644
   364
(* write out ? Or keep as a separate file and then cat them all together in the watcher, like we do with the *)
quigley@15644
   365
(*claset file and prob file*)
quigley@16357
   366
(* FIX*)
quigley@16039
   367
(*fun isar_local_thms (delta_cs, delta_ss_thms) =
paulson@15608
   368
    let val thms_cs = get_thms_cs delta_cs
paulson@15608
   369
	val thms_ss = get_thms_ss delta_ss_thms
paulson@15608
   370
	val thms_clauses = ResLib.flat_noDup (map ResAxioms.clausify_axiom (thms_cs @ thms_ss))
paulson@15608
   371
	val clauses_strs = ResLib.flat_noDup (map ResClause.tptp_clause thms_clauses) (*string list*)
wenzelm@16259
   372
	val ax_file = File.platform_path axiom_file
paulson@15608
   373
	val out = TextIO.openOut ax_file
paulson@15608
   374
    in
quigley@15644
   375
	(ResLib.writeln_strs out clauses_strs; (warning ("axiom file is: "^ax_file));TextIO.closeOut out)
paulson@15608
   376
    end;
quigley@16039
   377
*)
paulson@15608
   378
paulson@15608
   379
quigley@16357
   380
quigley@16357
   381
paulson@15608
   382
(* called in Isar automatically *)
quigley@15679
   383
paulson@15608
   384
fun isar_atp (ctxt,thm) =
paulson@15608
   385
    let val prems = ProofContext.prems_of ctxt
quigley@15644
   386
        val d_cs = Classical.get_delta_claset ctxt 
quigley@15644
   387
        val d_ss_thms = Simplifier.get_delta_simpset ctxt
quigley@15644
   388
        val thmstring = string_of_thm thm
quigley@15679
   389
        val sg_prems = prems_of thm
paulson@15697
   390
        val sign = sign_of_thm thm
quigley@15679
   391
        val prem_no = length sg_prems
quigley@15779
   392
        val prems_string = Meson.concat_with_and (map (Sign.string_of_term sign) sg_prems) 
paulson@15608
   393
    in
quigley@15644
   394
          (warning ("initial thm in isar_atp: "^thmstring));
quigley@15644
   395
          (warning ("subgoals in isar_atp: "^prems_string));
quigley@15779
   396
    	  (warning ("number of subgoals in isar_atp: "^(string_of_int prem_no)));
quigley@16357
   397
          (*isar_local_thms (d_cs,d_ss_thms);*)
quigley@16357
   398
           isar_atp' (ctxt,prems, thm)
paulson@15608
   399
    end;
paulson@15347
   400
paulson@15608
   401
end
paulson@15608
   402
paulson@15608
   403
quigley@16357
   404
quigley@16357
   405
paulson@15347
   406
end;
paulson@15347
   407
paulson@15347
   408
Proof.atp_hook := ResAtp.isar_atp;