src/Provers/eqsubst.ML
author dixon
Tue May 03 02:45:55 2005 +0200 (2005-05-03)
changeset 15915 b0e8b37642a4
parent 15855 55e443aa711d
child 15929 68bd1e16552a
permissions -rw-r--r--
lucas - improved interface to isand.ML and cleaned up clean-unification code, and added some better comments.
paulson@15481
     1
(* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *) 
dixon@15538
     2
(*  Title:      Provers/eqsubst.ML
paulson@15481
     3
    Author:     Lucas Dixon, University of Edinburgh
paulson@15481
     4
                lucas.dixon@ed.ac.uk
dixon@15538
     5
    Modified:   18 Feb 2005 - Lucas - 
paulson@15481
     6
    Created:    29 Jan 2005
paulson@15481
     7
*)
paulson@15481
     8
(* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *) 
paulson@15481
     9
(*  DESCRIPTION:
paulson@15481
    10
paulson@15481
    11
    A Tactic to perform a substiution using an equation.
paulson@15481
    12
paulson@15481
    13
*)
paulson@15481
    14
(* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *)
paulson@15481
    15
dixon@15538
    16
(* Logic specific data stub *)
paulson@15481
    17
signature EQRULE_DATA =
paulson@15481
    18
sig
dixon@15538
    19
paulson@15481
    20
  (* to make a meta equality theorem in the current logic *)
paulson@15481
    21
  val prep_meta_eq : thm -> thm list
dixon@15538
    22
paulson@15481
    23
end;
paulson@15481
    24
dixon@15538
    25
paulson@15481
    26
(* the signature of an instance of the SQSUBST tactic *)
paulson@15481
    27
signature EQSUBST_TAC = 
paulson@15481
    28
sig
dixon@15538
    29
dixon@15550
    30
  type match = 
dixon@15915
    31
       ((Term.indexname * (Term.sort * Term.typ)) list (* type instantiations *)
dixon@15915
    32
        * (Term.indexname * (Term.typ * Term.term)) list) (* term instantiations *)
dixon@15814
    33
       * (string * Term.typ) list (* fake named type abs env *)
dixon@15814
    34
       * (string * Term.typ) list (* type abs env *)
dixon@15814
    35
       * Term.term (* outer term *)
dixon@15550
    36
dixon@15538
    37
  val prep_subst_in_asm :
dixon@15538
    38
      (Sign.sg (* sign for matching *)
dixon@15538
    39
       -> int (* maxidx *)
dixon@15538
    40
       -> 'a (* input object kind *)
dixon@15538
    41
       -> BasicIsaFTerm.FcTerm (* focusterm to search under *)
dixon@15538
    42
       -> 'b) (* result type *)
dixon@15538
    43
      -> int (* subgoal to subst in *)
dixon@15538
    44
      -> Thm.thm (* target theorem with subgoals *)
dixon@15538
    45
      -> int (* premise to subst in *)
dixon@15538
    46
      -> (Thm.cterm list (* certified free var placeholders for vars *) 
dixon@15538
    47
          * int (* premice no. to subst *)
dixon@15538
    48
          * int (* number of assumptions of premice *)
dixon@15538
    49
          * Thm.thm) (* premice as a new theorem for forward reasoning *)
dixon@15538
    50
         * ('a -> 'b) (* matchf *)
dixon@15538
    51
dixon@15538
    52
  val prep_subst_in_asms :
dixon@15538
    53
      (Sign.sg -> int -> 'a -> BasicIsaFTerm.FcTerm -> 'b) 
dixon@15538
    54
      -> int (* subgoal to subst in *)
dixon@15538
    55
      -> Thm.thm (* target theorem with subgoals *)
dixon@15538
    56
      -> ((Thm.cterm list (* certified free var placeholders for vars *) 
dixon@15538
    57
          * int (* premice no. to subst *)
dixon@15538
    58
          * int (* number of assumptions of premice *)
dixon@15538
    59
          * Thm.thm) (* premice as a new theorem for forward reasoning *)
dixon@15538
    60
         * ('a -> 'b)) (* matchf *)
dixon@15538
    61
                       Seq.seq
dixon@15538
    62
dixon@15538
    63
  val apply_subst_in_asm :
dixon@15538
    64
      int (* subgoal *)
dixon@15538
    65
      -> Thm.thm (* overall theorem *)
dixon@15538
    66
      -> (Thm.cterm list (* certified free var placeholders for vars *) 
dixon@15538
    67
          * int (* assump no being subst *)
dixon@15538
    68
          * int (* num of premises of asm *) 
dixon@15538
    69
          * Thm.thm) (* premthm *)
dixon@15538
    70
      -> Thm.thm (* rule *)
dixon@15550
    71
      -> match
dixon@15538
    72
      -> Thm.thm Seq.seq
dixon@15538
    73
dixon@15538
    74
  val prep_concl_subst :
dixon@15538
    75
      (Sign.sg -> int -> 'a -> BasicIsaFTerm.FcTerm -> 'b) (* searchf *) 
dixon@15538
    76
      -> int (* subgoal *)
dixon@15538
    77
      -> Thm.thm (* overall goal theorem *)
dixon@15538
    78
      -> (Thm.cterm list * Thm.thm) * ('a -> 'b) (* (cvfs, conclthm), matchf *)
dixon@15538
    79
dixon@15538
    80
  val apply_subst_in_concl :
dixon@15538
    81
        int (* subgoal *)
dixon@15538
    82
        -> Thm.thm (* thm with all goals *)
dixon@15538
    83
        -> Thm.cterm list (* certified free var placeholders for vars *)
dixon@15538
    84
           * Thm.thm  (* trivial thm of goal concl *)
dixon@15538
    85
            (* possible matches/unifiers *)
dixon@15538
    86
        -> Thm.thm (* rule *)
dixon@15550
    87
        -> match
dixon@15538
    88
        -> Thm.thm Seq.seq (* substituted goal *)
dixon@15538
    89
dixon@15814
    90
  val searchf_tlr_unify_all : 
dixon@15814
    91
      (Sign.sg -> int ->
dixon@15814
    92
       Term.term ->
dixon@15814
    93
       BasicIsaFTerm.FcTerm ->
dixon@15814
    94
       match Seq.seq)
dixon@15814
    95
  val searchf_tlr_unify_valid : 
dixon@15814
    96
      (Sign.sg -> int ->
dixon@15814
    97
       Term.term ->
dixon@15814
    98
       BasicIsaFTerm.FcTerm ->
dixon@15814
    99
       match Seq.seq)
dixon@15814
   100
paulson@15481
   101
  val eqsubst_asm_meth : Thm.thm list -> Proof.method
paulson@15481
   102
  val eqsubst_asm_tac : Thm.thm list -> int -> Thm.thm -> Thm.thm Seq.seq
dixon@15814
   103
  val eqsubst_asm_tac' : 
dixon@15814
   104
      (Sign.sg -> int ->
dixon@15814
   105
       Term.term ->
dixon@15814
   106
       BasicIsaFTerm.FcTerm ->
dixon@15814
   107
       match Seq.seq) -> Thm.thm -> int -> Thm.thm -> Thm.thm Seq.seq
dixon@15538
   108
paulson@15481
   109
  val eqsubst_meth : Thm.thm list -> Proof.method
paulson@15481
   110
  val eqsubst_tac : Thm.thm list -> int -> Thm.thm -> Thm.thm Seq.seq
dixon@15814
   111
  val eqsubst_tac' : 
dixon@15814
   112
      (Sign.sg -> int ->
dixon@15814
   113
       Term.term ->
dixon@15814
   114
       BasicIsaFTerm.FcTerm ->
dixon@15814
   115
       match Seq.seq) -> Thm.thm -> int -> Thm.thm -> Thm.thm Seq.seq
dixon@15538
   116
paulson@15481
   117
  val meth : bool * Thm.thm list -> Proof.context -> Proof.method
paulson@15481
   118
  val setup : (Theory.theory -> Theory.theory) list
paulson@15481
   119
end;
paulson@15481
   120
paulson@15481
   121
functor EQSubstTacFUN (structure EqRuleData : EQRULE_DATA) 
dixon@15538
   122
  : EQSUBST_TAC
paulson@15481
   123
= struct
paulson@15481
   124
dixon@15915
   125
  (* a type abriviation for match information *)
dixon@15550
   126
  type match = 
dixon@15915
   127
       ((Term.indexname * (Term.sort * Term.typ)) list (* type instantiations *)
dixon@15915
   128
        * (Term.indexname * (Term.typ * Term.term)) list) (* term instantiations *)
dixon@15915
   129
       * (string * Term.typ) list (* fake named type abs env *)
dixon@15915
   130
       * (string * Term.typ) list (* type abs env *)
dixon@15915
   131
       * Term.term (* outer term *)
dixon@15550
   132
dixon@15550
   133
dixon@15538
   134
(* FOR DEBUGGING...
dixon@15538
   135
type trace_subst_errT = int (* subgoal *)
dixon@15538
   136
        * Thm.thm (* thm with all goals *)
dixon@15538
   137
        * (Thm.cterm list (* certified free var placeholders for vars *)
dixon@15538
   138
           * Thm.thm)  (* trivial thm of goal concl *)
dixon@15538
   139
            (* possible matches/unifiers *)
dixon@15538
   140
        * Thm.thm (* rule *)
dixon@15538
   141
        * (((Term.indexname * Term.typ) list (* type instantiations *)
dixon@15538
   142
              * (Term.indexname * Term.term) list ) (* term instantiations *)
dixon@15538
   143
             * (string * Term.typ) list (* Type abs env *)
dixon@15538
   144
             * Term.term) (* outer term *);
dixon@15538
   145
dixon@15538
   146
val trace_subst_err = (ref NONE : trace_subst_errT option ref);
dixon@15538
   147
val trace_subst_search = ref false;
dixon@15538
   148
exception trace_subst_exp of trace_subst_errT;
dixon@15538
   149
 *)
dixon@15538
   150
dixon@15538
   151
(* also defined in /HOL/Tools/inductive_codegen.ML, 
dixon@15538
   152
   maybe move this to seq.ML ? *)
dixon@15538
   153
infix 5 :->;
dixon@15538
   154
fun s :-> f = Seq.flat (Seq.map f s);
dixon@15538
   155
dixon@15814
   156
(* search from top, left to right, then down *)
dixon@15814
   157
fun search_tlr_all_f f ft = 
paulson@15481
   158
    let
paulson@15481
   159
      fun maux ft = 
paulson@15481
   160
          let val t' = (IsaFTerm.focus_of_fcterm ft) 
dixon@15538
   161
            (* val _ = 
dixon@15538
   162
                if !trace_subst_search then 
dixon@15538
   163
                  (writeln ("Examining: " ^ (TermLib.string_of_term t'));
dixon@15538
   164
                   TermLib.writeterm t'; ())
dixon@15538
   165
                else (); *)
paulson@15481
   166
          in 
paulson@15481
   167
          (case t' of 
dixon@15538
   168
            (_ $ _) => Seq.append(maux (IsaFTerm.focus_left ft), 
dixon@15538
   169
                       Seq.append(f ft, 
paulson@15481
   170
                                  maux (IsaFTerm.focus_right ft)))
dixon@15814
   171
          | (Abs _) => Seq.append(f ft, maux (IsaFTerm.focus_abs ft))
paulson@15481
   172
          | leaf => f ft) end
paulson@15481
   173
    in maux ft end;
paulson@15481
   174
dixon@15814
   175
(* search from top, left to right, then down *)
dixon@15814
   176
fun search_tlr_valid_f f ft = 
dixon@15814
   177
    let
dixon@15814
   178
      fun maux ft = 
dixon@15814
   179
          let 
dixon@15814
   180
            val hereseq = if IsaFTerm.valid_match_start ft then f ft else Seq.empty
dixon@15814
   181
          in 
dixon@15814
   182
          (case (IsaFTerm.focus_of_fcterm ft) of 
dixon@15814
   183
            (_ $ _) => Seq.append(maux (IsaFTerm.focus_left ft), 
dixon@15814
   184
                       Seq.append(hereseq, 
dixon@15814
   185
                                  maux (IsaFTerm.focus_right ft)))
dixon@15814
   186
          | (Abs _) => Seq.append(hereseq, maux (IsaFTerm.focus_abs ft))
dixon@15814
   187
          | leaf => hereseq)
dixon@15814
   188
          end
dixon@15814
   189
    in maux ft end;
dixon@15814
   190
dixon@15814
   191
(* search all unifications *)
dixon@15814
   192
fun searchf_tlr_unify_all sgn maxidx lhs  = 
paulson@15481
   193
    IsaFTerm.find_fcterm_matches 
dixon@15814
   194
      search_tlr_all_f 
paulson@15481
   195
      (IsaFTerm.clean_unify_ft sgn maxidx lhs);
paulson@15481
   196
dixon@15814
   197
(* search only for 'valid' unifiers (non abs subterms and non vars) *)
dixon@15814
   198
fun searchf_tlr_unify_valid sgn maxidx lhs  = 
dixon@15814
   199
    IsaFTerm.find_fcterm_matches 
dixon@15814
   200
      search_tlr_valid_f 
dixon@15814
   201
      (IsaFTerm.clean_unify_ft sgn maxidx lhs);
dixon@15814
   202
dixon@15814
   203
dixon@15538
   204
(* apply a substitution in the conclusion of the theorem th *)
dixon@15538
   205
(* cfvs are certified free var placeholders for goal params *)
dixon@15538
   206
(* conclthm is a theorem of for just the conclusion *)
dixon@15538
   207
(* m is instantiation/match information *)
dixon@15538
   208
(* rule is the equation for substitution *)
dixon@15538
   209
fun apply_subst_in_concl i th (cfvs, conclthm) rule m = 
dixon@15538
   210
    (RWInst.rw m rule conclthm)
dixon@15855
   211
      |> IsaND.unfix_frees cfvs
dixon@15915
   212
      |> RWInst.beta_eta_contract
dixon@15538
   213
      |> (fn r => Tactic.rtac r i th);
paulson@15481
   214
dixon@15538
   215
(*
paulson@15481
   216
dixon@15538
   217
 |> (fn r => Thm.bicompose false (false, r, Thm.nprems_of r) i th)
dixon@15538
   218
dixon@15538
   219
*)
paulson@15481
   220
paulson@15481
   221
(* substitute within the conclusion of goal i of gth, using a meta
dixon@15538
   222
equation rule. Note that we assume rule has var indicies zero'd *)
dixon@15538
   223
fun prep_concl_subst searchf i gth = 
paulson@15481
   224
    let 
paulson@15481
   225
      val th = Thm.incr_indexes 1 gth;
paulson@15481
   226
      val tgt_term = Thm.prop_of th;
paulson@15481
   227
paulson@15481
   228
      val sgn = Thm.sign_of_thm th;
paulson@15481
   229
      val ctermify = Thm.cterm_of sgn;
paulson@15481
   230
      val trivify = Thm.trivial o ctermify;
paulson@15481
   231
paulson@15481
   232
      val (fixedbody, fvs) = IsaND.fix_alls_term i tgt_term;
paulson@15481
   233
      val cfvs = rev (map ctermify fvs);
paulson@15481
   234
dixon@15538
   235
      val conclterm = Logic.strip_imp_concl fixedbody;
dixon@15538
   236
      val conclthm = trivify conclterm;
dixon@15538
   237
      val maxidx = Term.maxidx_of_term conclterm;
paulson@15481
   238
    in
dixon@15538
   239
      ((cfvs, conclthm), 
dixon@15538
   240
       (fn lhs => searchf sgn maxidx lhs 
dixon@15538
   241
                          ((IsaFTerm.focus_right  
dixon@15538
   242
                            o IsaFTerm.focus_left
dixon@15538
   243
                            o IsaFTerm.fcterm_of_term 
dixon@15538
   244
                            o Thm.prop_of) conclthm)))
paulson@15481
   245
    end;
paulson@15481
   246
dixon@15538
   247
paulson@15481
   248
(* substitute using an object or meta level equality *)
dixon@15814
   249
fun eqsubst_tac' searchf instepthm i th = 
dixon@15538
   250
    let 
dixon@15538
   251
      val (cvfsconclthm, findmatchf) = 
dixon@15814
   252
          prep_concl_subst searchf i th;
dixon@15538
   253
dixon@15538
   254
      val stepthms = 
dixon@15538
   255
          Seq.map Drule.zero_var_indexes 
dixon@15538
   256
                  (Seq.of_list (EqRuleData.prep_meta_eq instepthm));
dixon@15538
   257
dixon@15538
   258
      fun rewrite_with_thm r =
dixon@15538
   259
          let val (lhs,_) = Logic.dest_equals (Thm.concl_of r);
dixon@15538
   260
          in (findmatchf lhs)
dixon@15538
   261
             :-> (apply_subst_in_concl i th cvfsconclthm r) end;
dixon@15538
   262
dixon@15538
   263
    in (stepthms :-> rewrite_with_thm) end;
dixon@15538
   264
dixon@15538
   265
paulson@15481
   266
(* substitute using one of the given theorems *)
paulson@15481
   267
fun eqsubst_tac instepthms i th = 
dixon@15538
   268
    if Thm.nprems_of th < i then Seq.empty else
dixon@15814
   269
    (Seq.of_list instepthms) 
dixon@15814
   270
    :-> (fn r => eqsubst_tac' searchf_tlr_unify_valid r i th);
paulson@15481
   271
paulson@15481
   272
(* inthms are the given arguments in Isar, and treated as eqstep with
paulson@15481
   273
   the first one, then the second etc *)
paulson@15481
   274
fun eqsubst_meth inthms =
paulson@15481
   275
    Method.METHOD 
dixon@15538
   276
      (fn facts =>
dixon@15538
   277
          HEADGOAL ( Method.insert_tac facts THEN' eqsubst_tac inthms ));
paulson@15481
   278
paulson@15481
   279
dixon@15538
   280
fun apply_subst_in_asm i th (cfvs, j, nprems, pth) rule m = 
dixon@15538
   281
    (RWInst.rw m rule pth)
dixon@15538
   282
      |> Thm.permute_prems 0 ~1
dixon@15855
   283
      |> IsaND.unfix_frees cfvs
dixon@15915
   284
      |> RWInst.beta_eta_contract
dixon@15538
   285
      |> (fn r => Tactic.dtac r i th);
dixon@15538
   286
dixon@15538
   287
(*
dixon@15538
   288
? should I be using bicompose what if we match more than one
dixon@15538
   289
assumption, even after instantiation ? (back will work, but it would
dixon@15538
   290
be nice to avoid the redudent search)
dixon@15538
   291
dixon@15538
   292
something like... 
dixon@15538
   293
 |> Thm.lift_rule (th, i)
dixon@15538
   294
 |> (fn r => Thm.bicompose false (false, r, Thm.nprems_of r - nprems) i th)
dixon@15538
   295
dixon@15538
   296
*)
paulson@15481
   297
paulson@15481
   298
dixon@15538
   299
(* prepare to substitute within the j'th premise of subgoal i of gth,
dixon@15538
   300
using a meta-level equation. Note that we assume rule has var indicies
dixon@15538
   301
zero'd. Note that we also assume that premt is the j'th premice of
dixon@15538
   302
subgoal i of gth. Note the repetition of work done for each
dixon@15538
   303
assumption, i.e. this can be made more efficient for search over
dixon@15538
   304
multiple assumptions.  *)
dixon@15538
   305
fun prep_subst_in_asm searchf i gth j = 
paulson@15481
   306
    let 
paulson@15481
   307
      val th = Thm.incr_indexes 1 gth;
paulson@15481
   308
      val tgt_term = Thm.prop_of th;
paulson@15481
   309
paulson@15481
   310
      val sgn = Thm.sign_of_thm th;
paulson@15481
   311
      val ctermify = Thm.cterm_of sgn;
paulson@15481
   312
      val trivify = Thm.trivial o ctermify;
paulson@15481
   313
paulson@15481
   314
      val (fixedbody, fvs) = IsaND.fix_alls_term i tgt_term;
paulson@15481
   315
      val cfvs = rev (map ctermify fvs);
paulson@15481
   316
dixon@15538
   317
      val asmt = Library.nth_elem(j - 1,(Logic.strip_imp_prems fixedbody));
dixon@15538
   318
      val asm_nprems = length (Logic.strip_imp_prems asmt);
dixon@15538
   319
dixon@15538
   320
      val pth = trivify asmt;
dixon@15538
   321
      val maxidx = Term.maxidx_of_term asmt;
dixon@15538
   322
paulson@15481
   323
    in
dixon@15538
   324
      ((cfvs, j, asm_nprems, pth), 
dixon@15538
   325
       (fn lhs => (searchf sgn maxidx lhs
dixon@15538
   326
                           ((IsaFTerm.focus_right 
dixon@15538
   327
                             o IsaFTerm.fcterm_of_term 
dixon@15538
   328
                             o Thm.prop_of) pth))))
paulson@15481
   329
    end;
paulson@15481
   330
dixon@15538
   331
(* prepare subst in every possible assumption *)
dixon@15538
   332
fun prep_subst_in_asms searchf i gth = 
dixon@15538
   333
    Seq.map 
dixon@15538
   334
      (prep_subst_in_asm searchf i gth)
dixon@15538
   335
      (Seq.of_list (IsaPLib.mk_num_list
dixon@15538
   336
                      (length (Logic.prems_of_goal (Thm.prop_of gth) i))));
dixon@15538
   337
dixon@15538
   338
dixon@15538
   339
(* substitute in an assumption using an object or meta level equality *)
dixon@15814
   340
fun eqsubst_asm_tac' searchf instepthm i th = 
dixon@15538
   341
    let 
dixon@15814
   342
      val asmpreps = prep_subst_in_asms searchf i th;
dixon@15538
   343
      val stepthms = 
dixon@15538
   344
          Seq.map Drule.zero_var_indexes 
dixon@15538
   345
                  (Seq.of_list (EqRuleData.prep_meta_eq instepthm))
dixon@15538
   346
dixon@15538
   347
      fun rewrite_with_thm (asminfo, findmatchf) r =
dixon@15538
   348
          let val (lhs,_) = Logic.dest_equals (Thm.concl_of r);
dixon@15538
   349
          in (findmatchf lhs)
dixon@15538
   350
             :-> (apply_subst_in_asm i th asminfo r) end;
dixon@15538
   351
    in
dixon@15538
   352
      (asmpreps :-> (fn a => stepthms :-> rewrite_with_thm a))
paulson@15481
   353
    end;
paulson@15481
   354
paulson@15481
   355
(* substitute using one of the given theorems *)
paulson@15481
   356
fun eqsubst_asm_tac instepthms i th = 
dixon@15538
   357
    if Thm.nprems_of th < i then Seq.empty else
dixon@15814
   358
    (Seq.of_list instepthms) 
dixon@15814
   359
    :-> (fn r => eqsubst_asm_tac' searchf_tlr_unify_valid r i th);
paulson@15481
   360
paulson@15481
   361
(* inthms are the given arguments in Isar, and treated as eqstep with
paulson@15481
   362
   the first one, then the second etc *)
paulson@15481
   363
fun eqsubst_asm_meth inthms =
paulson@15481
   364
    Method.METHOD 
dixon@15538
   365
      (fn facts =>
dixon@15538
   366
          HEADGOAL (Method.insert_tac facts THEN' eqsubst_asm_tac inthms ));
paulson@15481
   367
paulson@15481
   368
(* combination method that takes a flag (true indicates that subst
paulson@15481
   369
should be done to an assumption, false = apply to the conclusion of
paulson@15481
   370
the goal) as well as the theorems to use *)
paulson@15481
   371
fun meth (asmflag, inthms) ctxt = 
paulson@15481
   372
    if asmflag then eqsubst_asm_meth inthms else eqsubst_meth inthms;
paulson@15481
   373
paulson@15481
   374
(* syntax for options, given "(asm)" will give back true, without
paulson@15481
   375
   gives back false *)
paulson@15481
   376
val options_syntax =
paulson@15481
   377
    (Args.parens (Args.$$$ "asm") >> (K true)) ||
paulson@15481
   378
     (Scan.succeed false);
paulson@15481
   379
paulson@15481
   380
(* method syntax, first take options, then theorems *)
paulson@15481
   381
fun meth_syntax meth src ctxt =
paulson@15481
   382
    meth (snd (Method.syntax ((Scan.lift options_syntax) 
paulson@15481
   383
                                -- Attrib.local_thms) src ctxt)) 
paulson@15481
   384
         ctxt;
paulson@15481
   385
paulson@15481
   386
(* setup function for adding method to theory. *)
paulson@15481
   387
val setup = 
paulson@15481
   388
    [Method.add_method ("subst", meth_syntax meth, "Substiution with an equation. Use \"(asm)\" option to substitute in an assumption.")];
paulson@15481
   389
paulson@15481
   390
end;