src/Provers/simplifier.ML
author paulson
Sat, 10 Jan 1998 17:59:32 +0100
changeset 4552 bb8ff763c93d
parent 4366 4d84cdb0df42
child 4612 26764de50c74
permissions -rw-r--r--
Simplified proofs by omitting PA = {|XA, ...|} from RA2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
     1
(*  Title:      Provers/simplifier.ML
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     2
    ID:         $Id$
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
     3
    Author:     Tobias Nipkow and Markus Wenzel, TU Muenchen
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     4
3577
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
     5
Generic simplifier, suitable for most logics.  See also Pure/thm.ML
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
     6
for the actual meta level rewriting engine.
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     7
*)
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
     8
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
     9
infix 4
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    10
  setsubgoaler setloop addloop setSSolver addSSolver setSolver
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    11
  addSolver setmksimps addsimps delsimps addeqcongs deleqcongs
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    12
  settermless addsimprocs delsimprocs;
2567
7a28e02e10b7 added addloop (and also documentation of addsolver
oheimb
parents: 2521
diff changeset
    13
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
signature SIMPLIFIER =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
sig
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    17
  type simproc
3577
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    18
  val mk_simproc: string -> cterm list
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    19
    -> (Sign.sg -> thm list -> term -> thm option) -> simproc
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
  type simpset
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    21
  val empty_ss: simpset
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    22
  val rep_ss: simpset ->
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    23
   {mss: meta_simpset,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    24
    subgoal_tac:        simpset -> int -> tactic,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    25
    loop_tac:                      int -> tactic,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    26
           finish_tac: thm list -> int -> tactic,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    27
    unsafe_finish_tac: thm list -> int -> tactic};
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    28
  val print_ss: simpset -> unit
4366
4d84cdb0df42 added print_simpset;
wenzelm
parents: 4290
diff changeset
    29
  val print_simpset: theory -> unit
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    30
  val setsubgoaler: simpset *  (simpset -> int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    31
  val setloop:      simpset *             (int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    32
  val addloop:      simpset *             (int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    33
  val setSSolver:   simpset * (thm list -> int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    34
  val addSSolver:   simpset * (thm list -> int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    35
  val setSolver:    simpset * (thm list -> int -> tactic) -> simpset
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    36
  val addSolver:    simpset * (thm list -> int -> tactic) -> simpset
3577
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    37
  val setmksimps:   simpset * (thm -> thm list) -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    38
  val settermless:  simpset * (term * term -> bool) -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    39
  val addsimps:     simpset * thm list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    40
  val delsimps:     simpset * thm list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    41
  val addeqcongs:   simpset * thm list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    42
  val deleqcongs:   simpset * thm list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    43
  val addsimprocs:  simpset * simproc list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    44
  val delsimprocs:  simpset * simproc list -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    45
  val merge_ss:     simpset * simpset -> simpset
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    46
  val prems_of_ss:  simpset -> thm list
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    47
4124
1af16493c57f type object = exn (enhance readability);
wenzelm
parents: 4080
diff changeset
    48
  val simpset_thy_data: string * (object * (object -> object) *
4259
adbe3f4e7caf adapted print methods;
wenzelm
parents: 4124
diff changeset
    49
    (object * object -> object) * (Sign.sg -> object -> unit))
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    50
  val simpset_ref_of_sg: Sign.sg -> simpset ref
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    51
  val simpset_ref_of: theory -> simpset ref
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    52
  val simpset_of_sg: Sign.sg -> simpset
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    53
  val simpset_of: theory -> simpset
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    54
  val SIMPSET: (simpset -> tactic) -> tactic
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    55
  val SIMPSET': (simpset -> 'a -> tactic) -> 'a -> tactic
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    56
  val simpset: unit -> simpset
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    57
  val simpset_ref: unit -> simpset ref
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    58
  val Addsimps: thm list -> unit
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    59
  val Delsimps: thm list -> unit
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    60
  val Addsimprocs: simproc list -> unit
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    61
  val Delsimprocs: simproc list -> unit
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
    62
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    63
  val               simp_tac: simpset -> int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    64
  val           asm_simp_tac: simpset -> int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    65
  val          full_simp_tac: simpset -> int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    66
  val      asm_full_simp_tac: simpset -> int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    67
  val safe_asm_full_simp_tac: simpset -> int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    68
  val               Simp_tac:            int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    69
  val           Asm_simp_tac:            int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    70
  val          Full_simp_tac:            int -> tactic
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
    71
  val      Asm_full_simp_tac:            int -> tactic
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    72
  val          simplify: simpset -> thm -> thm
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    73
  val      asm_simplify: simpset -> thm -> thm
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    74
  val     full_simplify: simpset -> thm -> thm
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    75
  val asm_full_simplify: simpset -> thm -> thm
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    78
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    79
structure Simplifier: SIMPLIFIER =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    82
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    83
(** simplification procedures **)
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    84
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    85
(* datatype simproc *)
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    86
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    87
datatype simproc =
3577
9715b6e3ec5f added prems argument to simplification procedures;
wenzelm
parents: 3557
diff changeset
    88
  Simproc of string * cterm list * (Sign.sg -> thm list -> term -> thm option) * stamp;
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    89
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    90
fun mk_simproc name lhss proc =
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    91
  Simproc (name, map (Thm.cterm_fun Logic.varify) lhss, proc, stamp ());
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
    92
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
    93
fun rep_simproc (Simproc args) = args;
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    94
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    95
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
    96
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    97
(** simplification sets **)
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    98
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
    99
(* type simpset *)
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   100
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
datatype simpset =
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   102
  Simpset of {
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   103
    mss: meta_simpset,
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   104
    subgoal_tac:        simpset -> int -> tactic,
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   105
    loop_tac:                      int -> tactic,
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   106
           finish_tac: thm list -> int -> tactic,
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   107
    unsafe_finish_tac: thm list -> int -> tactic};
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   108
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   109
fun make_ss (mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac) =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   110
  Simpset {mss = mss, subgoal_tac = subgoal_tac, loop_tac = loop_tac,
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   111
    finish_tac = finish_tac, unsafe_finish_tac = unsafe_finish_tac};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
val empty_ss =
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   114
  make_ss (Thm.empty_mss, K (K no_tac), K no_tac, K (K no_tac), K (K no_tac));
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   115
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   116
fun rep_ss (Simpset args) = args;
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   117
fun prems_of_ss (Simpset {mss, ...}) = Thm.prems_of_mss mss;
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   118
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   119
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   120
(* print simpsets *)
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   121
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   122
fun print_ss ss =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   123
  let
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   124
    val Simpset {mss, ...} = ss;
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   125
    val {simps, procs, congs} = Thm.dest_mss mss;
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   126
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   127
    val pretty_thms = map Display.pretty_thm;
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   128
    fun pretty_proc (name, lhss) =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   129
      Pretty.big_list (name ^ ":") (map Display.pretty_cterm lhss);
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   130
  in
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   131
    Pretty.writeln (Pretty.big_list "simplification rules:" (pretty_thms simps));
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   132
    Pretty.writeln (Pretty.big_list "simplification procedures:" (map pretty_proc procs));
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   133
    Pretty.writeln (Pretty.big_list "congruences:" (pretty_thms congs))
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   134
  end;
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   135
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   136
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   137
(* extend simpsets *)
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   138
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   139
fun (Simpset {mss, subgoal_tac = _, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   140
    setsubgoaler subgoal_tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   141
  make_ss (mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   142
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   143
fun (Simpset {mss, subgoal_tac, loop_tac = _, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   144
    setloop loop_tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   145
  make_ss (mss, subgoal_tac, DETERM o loop_tac, finish_tac, unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   146
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   147
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   148
    addloop tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   149
  make_ss (mss, subgoal_tac, loop_tac ORELSE' (DETERM o tac), finish_tac, unsafe_finish_tac);
2567
7a28e02e10b7 added addloop (and also documentation of addsolver
oheimb
parents: 2521
diff changeset
   150
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   151
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac = _, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   152
    setSSolver finish_tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   153
  make_ss (mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   154
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   155
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   156
    addSSolver tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   157
  make_ss (mss, subgoal_tac, loop_tac, fn hyps => finish_tac hyps ORELSE' tac hyps,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   158
    unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   159
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   160
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac = _})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   161
    setSolver unsafe_finish_tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   162
  make_ss (mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   163
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   164
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   165
    addSolver tac =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   166
  make_ss (mss, subgoal_tac, loop_tac, finish_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   167
    fn hyps => unsafe_finish_tac hyps ORELSE' tac hyps);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   168
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   169
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   170
    setmksimps mk_simps =
2645
9d3a3e62bf34 mk_rews: automatically includes strip_shyps, zero_var_indexes;
wenzelm
parents: 2629
diff changeset
   171
  make_ss (Thm.set_mk_rews (mss, map (Thm.strip_shyps o Drule.zero_var_indexes) o mk_simps),
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   172
    subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
   173
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   174
fun (Simpset {mss, subgoal_tac, loop_tac,  finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   175
    settermless termless =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   176
  make_ss (Thm.set_termless (mss, termless), subgoal_tac, loop_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   177
    finish_tac, unsafe_finish_tac);
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   178
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   179
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   180
    addsimps rews =
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   181
  let val rews' = flat (map (Thm.mk_rews_of_mss mss) rews) in
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   182
    make_ss (Thm.add_simps (mss, rews'), subgoal_tac, loop_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   183
      finish_tac, unsafe_finish_tac)
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   184
  end;
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   185
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   186
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   187
    delsimps rews =
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   188
  let val rews' = flat (map (Thm.mk_rews_of_mss mss) rews) in
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   189
    make_ss (Thm.del_simps (mss, rews'), subgoal_tac, loop_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   190
      finish_tac, unsafe_finish_tac)
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   191
  end;
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   192
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   193
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   194
    addeqcongs newcongs =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   195
  make_ss (Thm.add_congs (mss, newcongs), subgoal_tac, loop_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   196
    finish_tac, unsafe_finish_tac);
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
   197
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   198
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   199
    deleqcongs oldcongs =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   200
  make_ss (Thm.del_congs (mss, oldcongs), subgoal_tac, loop_tac,
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   201
    finish_tac, unsafe_finish_tac);
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   202
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   203
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   204
    addsimprocs simprocs =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   205
  make_ss
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   206
    (Thm.add_simprocs (mss, map rep_simproc simprocs),
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   207
      subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
   208
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   209
fun (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac})
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   210
    delsimprocs simprocs =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   211
  make_ss
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   212
    (Thm.del_simprocs (mss, map rep_simproc simprocs),
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   213
      subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   214
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   215
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   216
(* merge simpsets *)	(*NOTE: ignores tactics of 2nd simpset*)
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   217
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   218
fun merge_ss
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   219
   (Simpset {mss = mss1, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac},
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   220
    Simpset {mss = mss2, ...}) =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   221
  make_ss (Thm.merge_mss (mss1, mss2),
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   222
    subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   223
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   224
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   225
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   226
(** simpset theory data **)
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   227
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   228
(* data kind simpset *)
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   229
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   230
val simpsetK = "simpset";
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   231
exception SimpsetData of simpset ref;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   232
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   233
local
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   234
  val empty = SimpsetData (ref empty_ss);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   235
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   236
  (*create new reference*)
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   237
  fun prep_ext (SimpsetData (ref ss)) = SimpsetData (ref ss);
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   238
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   239
  fun merge (SimpsetData (ref ss1), SimpsetData (ref ss2)) =
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   240
    SimpsetData (ref (merge_ss (ss1, ss2)));
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   241
4259
adbe3f4e7caf adapted print methods;
wenzelm
parents: 4124
diff changeset
   242
  fun print (_: Sign.sg) (SimpsetData (ref ss)) = print_ss ss;
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   243
in
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   244
  val simpset_thy_data = (simpsetK, (empty, prep_ext, merge, print));
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   245
end;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   246
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   247
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   248
(* access simpset *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   249
4366
4d84cdb0df42 added print_simpset;
wenzelm
parents: 4290
diff changeset
   250
fun print_simpset thy = Display.print_data thy simpsetK;
4d84cdb0df42 added print_simpset;
wenzelm
parents: 4290
diff changeset
   251
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   252
fun simpset_ref_of_sg sg =
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   253
  (case Sign.get_data sg simpsetK of
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   254
    SimpsetData r => r
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   255
  | _ => sys_error "simpset_ref_of_sg")
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   256
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   257
val simpset_ref_of = simpset_ref_of_sg o sign_of;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   258
val simpset_of_sg = ! o simpset_ref_of_sg;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   259
val simpset_of = simpset_of_sg o sign_of;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   260
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   261
fun SIMPSET tacf state = tacf (simpset_of_sg (sign_of_thm state)) state;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   262
fun SIMPSET' tacf i state = tacf (simpset_of_sg (sign_of_thm state)) i state;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   263
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   264
val simpset = simpset_of o Context.get_context;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   265
val simpset_ref = simpset_ref_of_sg o sign_of o Context.get_context;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   266
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   267
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   268
(* change simpset *)
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   269
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   270
fun change_simpset f x = simpset_ref () := (f (simpset (), x));
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   271
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   272
val Addsimps = change_simpset (op addsimps);
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   273
val Delsimps = change_simpset (op delsimps);
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   274
val Addsimprocs = change_simpset (op addsimprocs);
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   275
val Delsimprocs = change_simpset (op delsimprocs);
2509
0a7169d89b7a added termless parameter;
wenzelm
parents: 2503
diff changeset
   276
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   277
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   278
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   279
(** simplification tactics **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   280
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   281
fun NEWSUBGOALS tac tacf st0 =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   282
  st0 |> (tac THEN (fn st1 => tacf (nprems_of st1 - nprems_of st0) st1));
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   283
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   284
fun solve_all_tac (subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac) mss =
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   285
  let
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   286
    val ss =
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   287
      make_ss (mss, subgoal_tac, loop_tac, unsafe_finish_tac, unsafe_finish_tac);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   288
    val solve1_tac =
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   289
      NEWSUBGOALS (subgoal_tac ss 1) (fn n => if n < 0 then all_tac else no_tac);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   290
  in DEPTH_SOLVE solve1_tac end;
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   291
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   292
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   293
(*not totally safe: may instantiate unknowns that appear also in other subgoals*)
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   294
fun basic_gen_simp_tac mode =
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   295
  fn (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac}) =>
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   296
    let
1512
ce37c64244c0 Elimination of fully-functorial style.
paulson
parents: 1260
diff changeset
   297
      fun simp_loop_tac i thm =
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   298
        (asm_rewrite_goal_tac mode
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   299
          (solve_all_tac (subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac)) mss i
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   300
        THEN (finish_tac (prems_of_mss mss) i ORELSE looper i)) thm
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   301
      and allsimp i n = EVERY (map (fn j => simp_loop_tac (i + j)) (n downto 0))
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   302
      and looper i = TRY (NEWSUBGOALS (loop_tac i) (allsimp i));
217
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   303
  in simp_loop_tac end;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   304
3551
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   305
fun gen_simp_tac mode (ss as Simpset {unsafe_finish_tac, ...}) =
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   306
  basic_gen_simp_tac mode (ss setSSolver unsafe_finish_tac);
7c013a617813 added print_ss;
wenzelm
parents: 3537
diff changeset
   307
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   308
2503
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   309
val          simp_tac = gen_simp_tac (false, false);
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   310
val      asm_simp_tac = gen_simp_tac (false, true);
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   311
val     full_simp_tac = gen_simp_tac (true,  false);
7590fd5ce3c7 cleaned up (real changes next time);
wenzelm
parents: 1770
diff changeset
   312
val asm_full_simp_tac = gen_simp_tac (true,  true);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   313
2629
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   314
(*not totally safe: may instantiate unknowns that appear also in other subgoals*)
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   315
val safe_asm_full_simp_tac = basic_gen_simp_tac (true, true);
b442786d4469 added deleqcongs, richer rep_ss
oheimb
parents: 2567
diff changeset
   316
3728
f92594f65af6 Default simpset tactics now dereference "simpset"
paulson
parents: 3577
diff changeset
   317
(** The abstraction over the proof state delays the dereferencing **)
f92594f65af6 Default simpset tactics now dereference "simpset"
paulson
parents: 3577
diff changeset
   318
4080
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   319
fun          Simp_tac i st =          simp_tac (simpset ()) i st;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   320
fun      Asm_simp_tac i st =      asm_simp_tac (simpset ()) i st;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   321
fun     Full_simp_tac i st =     full_simp_tac (simpset ()) i st;
7dce11095b0a new implicit simpset mechanism based on Sign.sg anytype data;
wenzelm
parents: 3728
diff changeset
   322
fun Asm_full_simp_tac i st = asm_full_simp_tac (simpset ()) i st;
406
4d4e0442b106 simpset is hidden in a functor now.
nipkow
parents: 217
diff changeset
   323
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   324
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   325
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   326
(** simplification meta rules **)
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   327
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   328
fun simp mode (Simpset {mss, subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac}) thm =
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   329
  let
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   330
    val tacf = solve_all_tac (subgoal_tac, loop_tac, finish_tac, unsafe_finish_tac);
4271
3a82492e70c5 changed Pure/Sequence interface -- isatool fixseq;
wenzelm
parents: 4259
diff changeset
   331
    fun prover m th = apsome fst (Seq.pull (tacf m th));
3557
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   332
  in
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   333
    Drule.rewrite_thm mode prover mss thm
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   334
  end;
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   335
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   336
val          simplify = simp (false, false);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   337
val      asm_simplify = simp (false, true);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   338
val     full_simplify = simp (true, false);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   339
val asm_full_simplify = simp (true, true);
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   340
9546f8185c43 added simplification meta rules;
wenzelm
parents: 3551
diff changeset
   341
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   342
end;