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