src/HOL/Tools/res_atp.ML
author paulson
Fri Sep 02 17:55:24 2005 +0200 (2005-09-02)
changeset 17234 12a9393c5d77
parent 17231 f42bc4f7afdf
child 17235 8e55ad29b690
permissions -rw-r--r--
further tidying up of Isabelle-ATP link
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
wenzelm@16802
     8
signature RES_ATP =
wenzelm@16802
     9
sig
wenzelm@16802
    10
  val axiom_file : Path.T
wenzelm@16802
    11
(*val atp_ax_tac : thm list -> int -> Tactical.tactic*)
quigley@15644
    12
(*val atp_tac : int -> Tactical.tactic*)
wenzelm@16802
    13
  val full_spass: bool ref
quigley@16478
    14
(*val spass: bool ref*)
wenzelm@16802
    15
  val vampire: bool ref
wenzelm@16802
    16
  val custom_spass: string list ref
quigley@17150
    17
  val hook_count: int ref
quigley@17150
    18
(*  val invoke_atp: Toplevel.transition -> Toplevel.transition*)
paulson@15347
    19
end;
paulson@15347
    20
wenzelm@16802
    21
structure ResAtp: RES_ATP =
paulson@15347
    22
struct
paulson@15347
    23
quigley@17150
    24
quigley@17150
    25
val call_atp = ref false;
quigley@17150
    26
val hook_count = ref 0;
quigley@17150
    27
paulson@16904
    28
fun debug_tac tac = (debug "testing"; tac);
quigley@16478
    29
quigley@16357
    30
val full_spass = ref false;
quigley@16478
    31
quigley@16478
    32
(* use spass as default prover *)
quigley@16478
    33
(*val spass = ref true;*)
quigley@16478
    34
quigley@16520
    35
val custom_spass = ref ["Auto=0","-IORe","-IOFc","-RTaut","-RFSub","-RBSub","-DocProof","-TimeLimit=60"];
quigley@16478
    36
val vampire = ref false;
quigley@16478
    37
paulson@15608
    38
val skolem_tac = skolemize_tac;
paulson@15608
    39
quigley@15644
    40
val num_of_clauses = ref 0;
wenzelm@16802
    41
val clause_arr = Array.array (3500, ("empty", 0));
quigley@15644
    42
paulson@15347
    43
paulson@15608
    44
val atomize_tac =
paulson@15608
    45
    SUBGOAL
paulson@15608
    46
     (fn (prop,_) =>
wenzelm@16802
    47
         let val ts = Logic.strip_assums_hyp prop
wenzelm@16802
    48
         in EVERY1
wenzelm@16802
    49
                [METAHYPS
wenzelm@16802
    50
                     (fn hyps => (cut_facts_tac (map (ObjectLogic.atomize_thm o forall_intr_vars) hyps) 1)),
wenzelm@16802
    51
          REPEAT_DETERM_N (length ts) o (etac thin_rl)]
paulson@15608
    52
     end);
paulson@15347
    53
quigley@15644
    54
val axiom_file = File.tmp_path (Path.basic "axioms");
quigley@15644
    55
val clasimp_file = File.tmp_path (Path.basic "clasimp");
quigley@15644
    56
val hyps_file = File.tmp_path (Path.basic "hyps");
quigley@15644
    57
val prob_file = File.tmp_path (Path.basic "prob");
quigley@15644
    58
wenzelm@16802
    59
paulson@15347
    60
(**** for Isabelle/ML interface  ****)
paulson@15347
    61
paulson@16897
    62
(*Remove unwanted characters such as ? and newline from the textural 
paulson@16897
    63
  representation of a theorem (surely they don't need to be produced in 
paulson@16897
    64
  the first place?) *)
paulson@15608
    65
paulson@16897
    66
fun is_proof_char ch = (#" " <= ch andalso ch <= #"~" andalso ch <> #"?");
paulson@16897
    67
paulson@16897
    68
val proofstring =
paulson@16897
    69
    String.translate (fn c => if is_proof_char c then str c else "");
paulson@15608
    70
paulson@15452
    71
paulson@15347
    72
(**** For running in Isar ****)
paulson@15347
    73
paulson@15608
    74
(* same function as that in res_axioms.ML *)
paulson@15608
    75
fun repeat_RS thm1 thm2 =
paulson@15608
    76
    let val thm1' =  thm1 RS thm2 handle THM _ => thm1
paulson@15608
    77
    in
wenzelm@16802
    78
        if eq_thm(thm1,thm1') then thm1' else (repeat_RS thm1' thm2)
paulson@15608
    79
    end;
paulson@15608
    80
paulson@15608
    81
(* a special version of repeat_RS *)
paulson@15608
    82
fun repeat_someI_ex thm = repeat_RS thm someI_ex;
paulson@15608
    83
paulson@16925
    84
paulson@16925
    85
(*FIXME: is function isar_atp_h used? If not, delete!*)
quigley@15644
    86
(*********************************************************************)
paulson@15608
    87
(* convert clauses from "assume" to conjecture. write to file "hyps" *)
quigley@15644
    88
(* hypotheses of the goal currently being proved                     *)
quigley@15644
    89
(*********************************************************************)
quigley@16767
    90
(*perhaps have 2 different versions of this, depending on whether or not SpassComm.spass is set *)
paulson@15608
    91
fun isar_atp_h thms =
paulson@15608
    92
    let val prems = map (skolemize o make_nnf o ObjectLogic.atomize_thm) thms
quigley@15644
    93
        val prems' = map repeat_someI_ex prems
quigley@15644
    94
        val prems'' = make_clauses prems'
quigley@15644
    95
        val prems''' = ResAxioms.rm_Eps [] prems''
quigley@15644
    96
        val clss = map ResClause.make_conjecture_clause prems'''
paulson@15774
    97
	val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss) 
paulson@15608
    98
	val tfree_lits = ResLib.flat_noDup tfree_litss
quigley@16767
    99
        (* tfree clause is different in tptp and dfg versions *)
paulson@15608
   100
	val tfree_clss = map ResClause.tfree_clause tfree_lits 
wenzelm@16259
   101
        val hypsfile = File.platform_path hyps_file
wenzelm@16802
   102
        val out = TextIO.openOut(hypsfile)
paulson@15608
   103
    in
paulson@16904
   104
        ResLib.writeln_strs out (tfree_clss @ tptp_clss);
paulson@16904
   105
        TextIO.closeOut out; debug hypsfile;
paulson@16904
   106
        tfree_lits
paulson@15608
   107
    end;
paulson@15347
   108
quigley@15644
   109
quigley@15644
   110
(*********************************************************************)
quigley@15644
   111
(* write out a subgoal as tptp clauses to the file "probN"           *)
quigley@15644
   112
(* where N is the number of this subgoal                             *)
quigley@15644
   113
(*********************************************************************)
quigley@15644
   114
wenzelm@16802
   115
fun tptp_inputs_tfrees thms n tfrees =
wenzelm@16802
   116
    let
paulson@16904
   117
      val _ = debug ("in tptp_inputs_tfrees 0")
wenzelm@16802
   118
      val clss = map (ResClause.make_conjecture_clause_thm) thms
paulson@16904
   119
      val _ = debug ("in tptp_inputs_tfrees 1")
wenzelm@16802
   120
      val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss)
paulson@16904
   121
      val _ = debug ("in tptp_inputs_tfrees 2")
wenzelm@16802
   122
      val tfree_clss = map ResClause.tfree_clause ((ResLib.flat_noDup tfree_litss) \\ tfrees)
paulson@16904
   123
      val _ = debug ("in tptp_inputs_tfrees 3")
wenzelm@16802
   124
      val probfile = File.platform_path prob_file ^ "_" ^ string_of_int n
wenzelm@16802
   125
      val out = TextIO.openOut(probfile)
paulson@15608
   126
    in
wenzelm@16802
   127
      ResLib.writeln_strs out (tfree_clss @ tptp_clss);
wenzelm@16802
   128
      TextIO.closeOut out;
paulson@16904
   129
      debug probfile
paulson@15608
   130
    end;
paulson@15452
   131
paulson@15608
   132
quigley@16767
   133
(*********************************************************************)
quigley@16767
   134
(* write out a subgoal as DFG clauses to the file "probN"           *)
quigley@16767
   135
(* where N is the number of this subgoal                             *)
quigley@16767
   136
(*********************************************************************)
quigley@17150
   137
quigley@17150
   138
fun dfg_inputs_tfrees thms n tfrees axclauses = 
quigley@17150
   139
    let val clss = map (ResClause.make_conjecture_clause_thm) thms
quigley@16767
   140
        val probfile = (File.platform_path prob_file) ^ "_" ^ (string_of_int n)
paulson@17231
   141
        val _ = debug ("about to write out dfg prob file " ^ probfile)
quigley@17150
   142
       	(*val (dfg_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2dfg clss)
quigley@17150
   143
        val tfree_clss = map ResClause.tfree_dfg_clause ((ResLib.flat_noDup tfree_litss) \\ tfrees) *)   
paulson@17234
   144
        val probN = ResClause.clauses2dfg clss ("prob" ^ (string_of_int n)) 
paulson@17231
   145
                        axclauses [] [] [] tfrees   
quigley@16767
   146
	val out = TextIO.openOut(probfile)
quigley@16767
   147
    in
paulson@17234
   148
	(ResLib.writeln_strs out [probN]; TextIO.closeOut out; debug probfile )
paulson@17231
   149
(* (ResLib.writeln_strs out (tfree_clss @ dfg_clss); *)
quigley@17150
   150
    end;
quigley@17150
   151
quigley@16357
   152
quigley@15644
   153
(*********************************************************************)
quigley@15644
   154
(* call SPASS with settings and problem file for the current subgoal *)
quigley@15644
   155
(* should be modified to allow other provers to be called            *)
quigley@15644
   156
(*********************************************************************)
quigley@16357
   157
(* now passing in list of skolemized thms and list of sgterms to go with them *)
wenzelm@16802
   158
fun call_resolve_tac  (thms: thm list list)  sign (sg_terms:  term list) (childin, childout,pid) n  =
wenzelm@16802
   159
  let
wenzelm@16802
   160
    val axfile = (File.platform_path axiom_file)
quigley@16520
   161
quigley@16520
   162
    val hypsfile = (File.platform_path hyps_file)
wenzelm@16802
   163
    val clasimpfile = (File.platform_path clasimp_file)
quigley@16520
   164
wenzelm@16802
   165
    fun make_atp_list [] sign n = []
paulson@16897
   166
      | make_atp_list ((sko_thm, sg_term)::xs) sign n =
wenzelm@16802
   167
          let
paulson@16897
   168
            val thmstr = proofstring (Meson.concat_with_and (map string_of_thm sko_thm))
paulson@16904
   169
            val _ = debug ("thmstring in make_atp_lists is " ^ thmstr)
paulson@15608
   170
paulson@16897
   171
            val goalstring = proofstring (Sign.string_of_term sign sg_term)
paulson@16904
   172
            val _ = debug ("goalstring in make_atp_lists is " ^ goalstring)
quigley@16357
   173
paulson@16897
   174
            val probfile = File.platform_path prob_file ^ "_" ^ (string_of_int n)
paulson@16904
   175
            val _ = debug ("prob file in call_resolve_tac is " ^ probfile)
wenzelm@16802
   176
          in
wenzelm@16802
   177
            if !SpassComm.spass
wenzelm@16802
   178
            then
paulson@16897
   179
              let val optionline = (*Custom SPASS options, or default?*)
paulson@16897
   180
		      if !full_spass (*Auto mode: all SPASS inference rules*)
paulson@16897
   181
                      then "-DocProof%-TimeLimit=60%-SOS"
paulson@16897
   182
                      else "-" ^ space_implode "%-" (!custom_spass)
paulson@16904
   183
                  val _ = debug ("SPASS option string is " ^ optionline)
paulson@16897
   184
                  val _ = ResLib.helper_path "SPASS_HOME" "SPASS"
paulson@16897
   185
                    (*We've checked that SPASS is there for ATP/spassshell to run.*)
paulson@16897
   186
              in 
paulson@16897
   187
                  ([("spass", thmstr, goalstring,
paulson@16897
   188
                     getenv "ISABELLE_HOME" ^ "/src/HOL/Tools/ATP/spassshell",
paulson@16897
   189
                     optionline, clasimpfile, axfile, hypsfile, probfile)] @ 
paulson@16897
   190
                  (make_atp_list xs sign (n+1)))
wenzelm@16802
   191
              end
wenzelm@16802
   192
            else
wenzelm@16802
   193
              let val vampire = ResLib.helper_path "VAMPIRE_HOME" "vkernel"
wenzelm@16802
   194
              in
wenzelm@16802
   195
                ([("vampire", thmstr, goalstring, vampire, "-t 60%-m 100000",
wenzelm@16802
   196
                   clasimpfile, axfile, hypsfile, probfile)] @
wenzelm@16802
   197
                 (make_atp_list xs sign (n+1)))
wenzelm@16802
   198
              end
wenzelm@16802
   199
          end
paulson@15452
   200
paulson@16897
   201
    val atp_list = make_atp_list (ListPair.zip (thms, sg_terms)) sign 1
wenzelm@16802
   202
  in
wenzelm@16802
   203
    Watcher.callResProvers(childout,atp_list);
paulson@16904
   204
    debug "Sent commands to watcher!";
paulson@17234
   205
    all_tac
wenzelm@16802
   206
  end
quigley@16357
   207
quigley@15644
   208
(**********************************************************)
quigley@15644
   209
(* write out the current subgoal as a tptp file, probN,   *)
paulson@17234
   210
(* then call all_tac - should be call_res_tac           *)
quigley@15644
   211
(**********************************************************)
quigley@15679
   212
quigley@17150
   213
quigley@17150
   214
fun get_sko_thms tfrees sign sg_terms (childin, childout,pid) thm n sko_thms axclauses =
quigley@17150
   215
    if n=0 then 
quigley@17150
   216
       (call_resolve_tac  (rev sko_thms)
quigley@17150
   217
        sign  sg_terms (childin, childout, pid) (List.length sg_terms);
paulson@17234
   218
        all_tac thm)
quigley@17150
   219
     else
quigley@17150
   220
	
quigley@17150
   221
     ( SELECT_GOAL
quigley@17150
   222
        (EVERY1 [rtac ccontr,atomize_tac, skolemize_tac, 
paulson@17231
   223
          METAHYPS(fn negs => 
paulson@17231
   224
            (if !SpassComm.spass 
paulson@17231
   225
             then dfg_inputs_tfrees (make_clauses negs) n tfrees axclauses
paulson@17231
   226
             else tptp_inputs_tfrees (make_clauses negs) n tfrees;
paulson@17231
   227
             get_sko_thms tfrees sign sg_terms (childin, childout, pid) 
paulson@17231
   228
                          thm  (n -1) (negs::sko_thms) axclauses; 
paulson@17234
   229
             all_tac))]) n thm )
quigley@17150
   230
quigley@15644
   231
quigley@15644
   232
quigley@15644
   233
(**********************************************)
quigley@15644
   234
(* recursively call atp_tac_g on all subgoals *)
quigley@15644
   235
(* sg_term is the nth subgoal as a term - used*)
quigley@15644
   236
(* in proof reconstruction                    *)
quigley@15644
   237
(**********************************************)
quigley@15644
   238
quigley@17150
   239
fun isar_atp_goal' thm n tfree_lits (childin, childout, pid)  axclauses =
wenzelm@16802
   240
  let
wenzelm@16802
   241
    val prems = Thm.prems_of thm
wenzelm@16802
   242
    (*val sg_term = get_nth k prems*)
wenzelm@16802
   243
    val sign = sign_of_thm thm
wenzelm@16802
   244
    val thmstring = string_of_thm thm
wenzelm@16802
   245
  in
paulson@16904
   246
    debug("in isar_atp_goal'");
paulson@16904
   247
    debug("thmstring in isar_atp_goal': " ^ thmstring);
wenzelm@16802
   248
    (* go and call callResProvers with this subgoal *)
wenzelm@16802
   249
    (* isar_atp_g tfree_lits  sg_term (childin, childout, pid) k thm; *)
wenzelm@16802
   250
    (* recursive call to pick up the remaining subgoals *)
wenzelm@16802
   251
    (* isar_atp_goal' thm (k+1) n tfree_lits  (childin, childout, pid) *)
quigley@17150
   252
    get_sko_thms tfree_lits sign prems (childin, childout, pid) thm n []  axclauses
wenzelm@16802
   253
  end;
quigley@16520
   254
quigley@15644
   255
quigley@15644
   256
(**************************************************)
quigley@15644
   257
(* convert clauses from "assume" to conjecture.   *)
quigley@15644
   258
(* i.e. apply make_clauses and then get tptp for  *)
quigley@15679
   259
(* any hypotheses in the goal produced by assume  *)
quigley@15679
   260
(* statements;                                    *)
quigley@15644
   261
(* write to file "hyps"                           *)
quigley@15644
   262
(**************************************************)
quigley@15644
   263
paulson@17231
   264
fun isar_atp_aux thms thm n_subgoals  (childin, childout, pid) axclauses =
wenzelm@16802
   265
  let val tfree_lits = isar_atp_h thms
wenzelm@16802
   266
  in
paulson@16904
   267
    debug ("in isar_atp_aux");
quigley@17150
   268
    isar_atp_goal' thm n_subgoals tfree_lits (childin, childout, pid)  axclauses
wenzelm@16802
   269
  end;
quigley@15644
   270
quigley@15644
   271
(******************************************************************)
quigley@15644
   272
(* called in Isar automatically                                   *)
quigley@15644
   273
(* writes out the current clasimpset to a tptp file               *)
quigley@15644
   274
(* passes all subgoals on to isar_atp_aux for further processing  *)
quigley@15644
   275
(* turns off xsymbol at start of function, restoring it at end    *)
quigley@15644
   276
(******************************************************************)
quigley@15779
   277
(*FIX changed to clasimp_file *)
wenzelm@16802
   278
val isar_atp' = setmp print_mode [] (fn (ctxt, thms, thm) =>
wenzelm@16802
   279
  if Thm.no_prems thm then ()
wenzelm@16802
   280
  else
wenzelm@16802
   281
    let
paulson@16904
   282
      val _= debug ("in isar_atp'")
wenzelm@16802
   283
      val thy = ProofContext.theory_of ctxt
wenzelm@16802
   284
      val prems = Thm.prems_of thm
wenzelm@16802
   285
      val thms_string = Meson.concat_with_and (map string_of_thm thms)
wenzelm@16802
   286
      val thm_string = string_of_thm thm
wenzelm@16802
   287
      val prems_string = Meson.concat_with_and (map (Sign.string_of_term thy) prems)
wenzelm@16802
   288
wenzelm@16802
   289
      (*set up variables for writing out the clasimps to a tptp file*)
quigley@17150
   290
      val (clause_arr, num_of_clauses, axclauses) =
wenzelm@16802
   291
        ResClasimp.write_out_clasimp (File.platform_path clasimp_file) thy
wenzelm@16802
   292
          (hd prems) (*FIXME: hack!! need to do all prems*)
quigley@17150
   293
      val _ = debug ("clasimp_file is " ^ File.platform_path clasimp_file ^ " with " ^ (string_of_int num_of_clauses)^ " clauses")
wenzelm@16802
   294
      val (childin, childout, pid) = Watcher.createWatcher (thm, clause_arr, num_of_clauses)
wenzelm@16802
   295
      val pid_string =
wenzelm@16802
   296
        string_of_int (Word.toInt (Word.fromLargeWord (Posix.Process.pidToWord pid)))
paulson@15608
   297
    in
paulson@16904
   298
      debug ("initial thms: " ^ thms_string);
paulson@16904
   299
      debug ("initial thm: " ^ thm_string);
paulson@16904
   300
      debug ("subgoals: " ^ prems_string);
paulson@16904
   301
      debug ("pid: "^ pid_string);
quigley@17150
   302
      isar_atp_aux thms thm (length prems) (childin, childout, pid) axclauses;
wenzelm@16802
   303
      ()
wenzelm@16802
   304
    end);
paulson@15608
   305
paulson@15452
   306
paulson@15608
   307
fun get_thms_cs claset =
wenzelm@16802
   308
  let val {safeEs, safeIs, hazEs, hazIs, ...} = rep_cs claset
wenzelm@16802
   309
  in safeEs @ safeIs @ hazEs @ hazIs end;
quigley@16357
   310
paulson@15608
   311
fun append_name name [] _ = []
wenzelm@16802
   312
  | append_name name (thm :: thms) k =
wenzelm@16802
   313
      Thm.name_thm ((name ^ "_" ^ string_of_int k), thm) :: append_name name thms (k + 1);
paulson@15608
   314
wenzelm@16802
   315
fun append_names (name :: names) (thms :: thmss) =
wenzelm@16802
   316
  append_name name thms 0 :: append_names names thmss;
quigley@16357
   317
paulson@15608
   318
fun get_thms_ss [] = []
paulson@15608
   319
  | get_thms_ss thms =
wenzelm@16802
   320
      let
wenzelm@16802
   321
        val names = map Thm.name_of_thm thms
paulson@15608
   322
        val thms' = map (mksimps mksimps_pairs) thms
paulson@15608
   323
        val thms'' = append_names names thms'
wenzelm@16802
   324
      in
wenzelm@16802
   325
        ResLib.flat_noDup thms''
wenzelm@16802
   326
      end;
paulson@15608
   327
paulson@15452
   328
paulson@15608
   329
(* convert locally declared rules to axiom clauses *)
paulson@15608
   330
wenzelm@16802
   331
fun subtract_simpset thy ctxt =
wenzelm@16802
   332
  let
wenzelm@16802
   333
    val rules1 = #rules (#1 (rep_ss (simpset_of thy)));
wenzelm@16802
   334
    val rules2 = #rules (#1 (rep_ss (local_simpset_of ctxt)));
wenzelm@16802
   335
  in map #thm (Net.subtract MetaSimplifier.eq_rrule rules1 rules2) end;
quigley@15679
   336
wenzelm@16802
   337
fun subtract_claset thy ctxt =
wenzelm@16802
   338
  let
wenzelm@16802
   339
    val (netI1, netE1) = #xtra_netpair (rep_cs (claset_of thy));
wenzelm@16802
   340
    val (netI2, netE2) = #xtra_netpair (rep_cs (local_claset_of ctxt));
wenzelm@16802
   341
    val subtract = map (#2 o #2) oo Net.subtract Tactic.eq_kbrl;
wenzelm@16802
   342
  in subtract netI1 netI2 @ subtract netE1 netE2 end;
paulson@15608
   343
paulson@15608
   344
quigley@16357
   345
wenzelm@16802
   346
(** the Isar toplevel hook **)
wenzelm@16802
   347
paulson@17091
   348
val invoke_atp = Toplevel.unknown_proof o Toplevel.keep (fn state =>
quigley@17150
   349
wenzelm@16802
   350
  let
quigley@17150
   351
paulson@17091
   352
    val proof = Toplevel.proof_of state
paulson@17091
   353
    val (ctxt, (_, goal)) = Proof.get_goal proof
paulson@17091
   354
        handle Proof.STATE _ => error "No goal present";
quigley@17150
   355
wenzelm@16802
   356
    val thy = ProofContext.theory_of ctxt;
wenzelm@16802
   357
wenzelm@16802
   358
    (* FIXME presently unused *)
wenzelm@16802
   359
    val ss_thms = subtract_simpset thy ctxt;
wenzelm@16802
   360
    val cs_thms = subtract_claset thy ctxt;
wenzelm@16802
   361
  in
paulson@17091
   362
    debug ("initial thm in isar_atp: " ^ 
paulson@17091
   363
           Pretty.string_of (ProofContext.pretty_thm ctxt goal));
paulson@17091
   364
    debug ("subgoals in isar_atp: " ^ 
paulson@17091
   365
           Pretty.string_of (ProofContext.pretty_term ctxt
paulson@17091
   366
             (Logic.mk_conjunction_list (Thm.prems_of goal))));
paulson@16904
   367
    debug ("number of subgoals in isar_atp: " ^ string_of_int (Thm.nprems_of goal));
quigley@17150
   368
    hook_count := !hook_count +1;
quigley@17150
   369
    debug ("in hook for time: " ^(string_of_int (!hook_count)) );
paulson@16925
   370
    ResClause.init thy;
wenzelm@16802
   371
    isar_atp' (ctxt, ProofContext.prems_of ctxt, goal)
wenzelm@16802
   372
  end);
quigley@16357
   373
paulson@17091
   374
val call_atpP =
paulson@17091
   375
  OuterSyntax.improper_command 
paulson@17091
   376
    "ProofGeneral.call_atp" 
paulson@17091
   377
    "call automatic theorem provers" 
paulson@17091
   378
    OuterKeyword.diag
paulson@17091
   379
    (Scan.succeed (Toplevel.no_timing o invoke_atp));
paulson@17091
   380
paulson@17091
   381
val _ = OuterSyntax.add_parsers [call_atpP];
paulson@17091
   382
paulson@15347
   383
end;