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