src/FOL/simpdata.ML
author oheimb
Fri, 07 Nov 1997 18:05:25 +0100
changeset 4189 b8c7a6bc6c16
parent 4188 1025a27b08f9
child 4203 ca73de799b73
permissions -rw-r--r--
added split_prem_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
     1
(*  Title:      FOL/simpdata
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
     4
    Copyright   1994  University of Cambridge
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Simplification data for FOL
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
(*** Rewrite rules ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
fun int_prove_fun s = 
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    12
 (writeln s;  
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    13
  prove_goal IFOL.thy s
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    14
   (fn prems => [ (cut_facts_tac prems 1), 
2601
b301958c465d Renamed structure Int (intuitionistic prover) to IntPr to prevent clash
paulson
parents: 2469
diff changeset
    15
                  (IntPr.fast_tac 1) ]));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    17
val conj_simps = map int_prove_fun
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    18
 ["P & True <-> P",      "True & P <-> P",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
  "P & False <-> False", "False & P <-> False",
2801
56948cb1a1f9 Added P&P&Q <-> P&Q and P|P|Q <-> P|Q
nipkow
parents: 2727
diff changeset
    20
  "P & P <-> P", "P & P & Q <-> P & Q",
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    21
  "P & ~P <-> False",    "~P & P <-> False",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
  "(P & Q) & R <-> P & (Q & R)"];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    24
val disj_simps = map int_prove_fun
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    25
 ["P | True <-> True",  "True | P <-> True",
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    26
  "P | False <-> P",    "False | P <-> P",
2801
56948cb1a1f9 Added P&P&Q <-> P&Q and P|P|Q <-> P|Q
nipkow
parents: 2727
diff changeset
    27
  "P | P <-> P", "P | P | Q <-> P | Q",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
  "(P | Q) | R <-> P | (Q | R)"];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    30
val not_simps = map int_prove_fun
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    31
 ["~(P|Q)  <-> ~P & ~Q",
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    32
  "~ False <-> True",   "~ True <-> False"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    34
val imp_simps = map int_prove_fun
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    35
 ["(P --> False) <-> ~P",       "(P --> True) <-> True",
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    36
  "(False --> P) <-> True",     "(True --> P) <-> P", 
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    37
  "(P --> P) <-> True",         "(P --> ~P) <-> ~P"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    39
val iff_simps = map int_prove_fun
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    40
 ["(True <-> P) <-> P",         "(P <-> True) <-> P",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
  "(P <-> P) <-> True",
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    42
  "(False <-> P) <-> ~P",       "(P <-> False) <-> ~P"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    44
val quant_simps = map int_prove_fun
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
    45
 ["(ALL x. P) <-> P",    "(EX x. P) <-> P"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
(*These are NOT supplied by default!*)
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    48
val distrib_simps  = map int_prove_fun
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    49
 ["P & (Q | R) <-> P&Q | P&R", 
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    50
  "(Q | R) & P <-> Q&P | R&P",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
  "(P | Q --> R) <-> (P --> R) & (Q --> R)"];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    53
(** Conversion into rewrite rules **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
53
f8f37a9a31dc Added gen_all to simpdata.ML.
nipkow
parents: 3
diff changeset
    55
fun gen_all th = forall_elim_vars (#maxidx(rep_thm th)+1) th;
f8f37a9a31dc Added gen_all to simpdata.ML.
nipkow
parents: 3
diff changeset
    56
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    57
(*Make atomic rewrite rules*)
429
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    58
fun atomize r =
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    59
  case concl_of r of
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    60
    Const("Trueprop",_) $ p =>
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    61
      (case p of
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    62
         Const("op -->",_)$_$_ => atomize(r RS mp)
429
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    63
       | Const("op &",_)$_$_   => atomize(r RS conjunct1) @
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    64
                                  atomize(r RS conjunct2)
429
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    65
       | Const("All",_)$_      => atomize(r RS spec)
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    66
       | Const("True",_)       => []    (*True is DELETED*)
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    67
       | Const("False",_)      => []    (*should False do something?*)
429
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    68
       | _                     => [r])
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    69
  | _ => [r];
888bbb4119f8 atomize: borrowed HOL version, which checks for both Trueprop
lcp
parents: 394
diff changeset
    70
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    71
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    72
val P_iff_F = int_prove_fun "~P ==> (P <-> False)";
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    73
val iff_reflection_F = P_iff_F RS iff_reflection;
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    74
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    75
val P_iff_T = int_prove_fun "P ==> (P <-> True)";
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    76
val iff_reflection_T = P_iff_T RS iff_reflection;
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    77
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    78
(*Make meta-equalities.  The operator below is Trueprop*)
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    79
fun mk_meta_eq th = case concl_of th of
394
432bb9995893 Modified mk_meta_eq to leave meta-equlities on unchanged.
nipkow
parents: 371
diff changeset
    80
    Const("==",_)$_$_           => th
432bb9995893 Modified mk_meta_eq to leave meta-equlities on unchanged.
nipkow
parents: 371
diff changeset
    81
  | _ $ (Const("op =",_)$_$_)   => th RS eq_reflection
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    82
  | _ $ (Const("op <->",_)$_$_) => th RS iff_reflection
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    83
  | _ $ (Const("Not",_)$_)      => th RS iff_reflection_F
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    84
  | _                           => th RS iff_reflection_T;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
981
864370666a24 Defined addss to perform simplification in a claset.
lcp
parents: 942
diff changeset
    86
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
    87
(*** Classical laws ***)
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    88
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
fun prove_fun s = 
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    90
 (writeln s;  
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    91
  prove_goal FOL.thy s
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    92
   (fn prems => [ (cut_facts_tac prems 1), 
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
    93
                  (Cla.fast_tac FOL_cs 1) ]));
745
45a789407806 added blank line
lcp
parents: 429
diff changeset
    94
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    95
(*Avoids duplication of subgoals after expand_if, when the true and false 
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    96
  cases boil down to the same thing.*) 
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    97
val cases_simp = prove_fun "(P --> Q) & (~P --> Q) <-> Q";
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    98
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    99
(*At present, miniscoping is for classical logic only.  We do NOT include
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   100
  distribution of ALL over &, or dually that of EX over |.*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   102
(*Miniscoping: pushing in existential quantifiers*)
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   103
val ex_simps = map prove_fun 
2065
b696f087f052 Addition of one-point quantifier rewrite rules
paulson
parents: 1961
diff changeset
   104
                ["(EX x. x=t & P(x)) <-> P(t)",
b696f087f052 Addition of one-point quantifier rewrite rules
paulson
parents: 1961
diff changeset
   105
                 "(EX x. t=x & P(x)) <-> P(t)",
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   106
                 "(EX x. P(x) & Q) <-> (EX x. P(x)) & Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   107
                 "(EX x. P & Q(x)) <-> P & (EX x. Q(x))",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   108
                 "(EX x. P(x) | Q) <-> (EX x. P(x)) | Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   109
                 "(EX x. P | Q(x)) <-> P | (EX x. Q(x))",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   110
                 "(EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   111
                 "(EX x. P --> Q(x)) <-> P --> (EX x. Q(x))"];
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   112
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   113
(*Miniscoping: pushing in universal quantifiers*)
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   114
val all_simps = map prove_fun
2065
b696f087f052 Addition of one-point quantifier rewrite rules
paulson
parents: 1961
diff changeset
   115
                ["(ALL x. x=t --> P(x)) <-> P(t)",
b696f087f052 Addition of one-point quantifier rewrite rules
paulson
parents: 1961
diff changeset
   116
                 "(ALL x. t=x --> P(x)) <-> P(t)",
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   117
                 "(ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   118
                 "(ALL x. P & Q(x)) <-> P & (ALL x. Q(x))",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   119
                 "(ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   120
                 "(ALL x. P | Q(x)) <-> P | (ALL x. Q(x))",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   121
                 "(ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q",
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   122
                 "(ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))"];
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   123
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   124
fun int_prove nm thm  = qed_goal nm IFOL.thy thm
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   125
    (fn prems => [ (cut_facts_tac prems 1), 
2601
b301958c465d Renamed structure Int (intuitionistic prover) to IntPr to prevent clash
paulson
parents: 2469
diff changeset
   126
                   (IntPr.fast_tac 1) ]);
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   127
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   128
fun prove nm thm  = qed_goal nm FOL.thy thm (fn _ => [Blast_tac 1]);
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   129
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   130
int_prove "conj_commute" "P&Q <-> Q&P";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   131
int_prove "conj_left_commute" "P&(Q&R) <-> Q&(P&R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   132
val conj_comms = [conj_commute, conj_left_commute];
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   133
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   134
int_prove "disj_commute" "P|Q <-> Q|P";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   135
int_prove "disj_left_commute" "P|(Q|R) <-> Q|(P|R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   136
val disj_comms = [disj_commute, disj_left_commute];
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   137
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   138
int_prove "conj_disj_distribL" "P&(Q|R) <-> (P&Q | P&R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   139
int_prove "conj_disj_distribR" "(P|Q)&R <-> (P&R | Q&R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   140
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   141
int_prove "disj_conj_distribL" "P|(Q&R) <-> (P|Q) & (P|R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   142
int_prove "disj_conj_distribR" "(P&Q)|R <-> (P|R) & (Q|R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   143
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   144
int_prove "imp_conj_distrib" "(P --> (Q&R)) <-> (P-->Q) & (P-->R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   145
int_prove "imp_conj"         "((P&Q)-->R)   <-> (P --> (Q --> R))";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   146
int_prove "imp_disj"         "(P|Q --> R)   <-> (P-->R) & (Q-->R)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   147
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   148
prove "imp_disj1" "(P-->Q) | R <-> (P-->Q | R)";
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   149
prove "imp_disj2" "Q | (P-->R) <-> (P-->Q | R)";
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   150
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   151
int_prove "de_Morgan_disj" "(~(P | Q)) <-> (~P & ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   152
prove     "de_Morgan_conj" "(~(P & Q)) <-> (~P | ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   153
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   154
prove     "not_iff" "~(P <-> Q) <-> (P <-> ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   155
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   156
prove     "not_all" "(~ (ALL x. P(x))) <-> (EX x.~P(x))";
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   157
prove     "imp_all" "((ALL x. P(x)) --> Q) <-> (EX x. P(x) --> Q)";
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   158
int_prove "not_ex"  "(~ (EX x. P(x))) <-> (ALL x.~P(x))";
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   159
int_prove "imp_ex" "((EX x. P(x)) --> Q) <-> (ALL x. P(x) --> Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   160
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   161
int_prove "ex_disj_distrib"
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   162
    "(EX x. P(x) | Q(x)) <-> ((EX x. P(x)) | (EX x. Q(x)))";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   163
int_prove "all_conj_distrib"
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   164
    "(ALL x. P(x) & Q(x)) <-> ((ALL x. P(x)) & (ALL x. Q(x)))";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   165
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   166
1088
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   167
(*Used in ZF, perhaps elsewhere?*)
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   168
val meta_eq_to_obj_eq = prove_goal IFOL.thy "x==y ==> x=y"
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   169
  (fn [prem] => [rewtac prem, rtac refl 1]);
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   170
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
(*** case splitting ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
1088
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   173
qed_goal "meta_iffD" IFOL.thy "[| P==Q; Q |] ==> P"
756
e0e5c1581e4c added qed_goal for meta_iffD
clasohm
parents: 745
diff changeset
   174
        (fn [prem1,prem2] => [rewtac prem1, rtac prem2 1]);
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
   175
942
d9edeb96b51c Enforced partial evaluation of mk_case_split_tac.
nipkow
parents: 784
diff changeset
   176
local val mktac = mk_case_split_tac meta_iffD
d9edeb96b51c Enforced partial evaluation of mk_case_split_tac.
nipkow
parents: 784
diff changeset
   177
in
d9edeb96b51c Enforced partial evaluation of mk_case_split_tac.
nipkow
parents: 784
diff changeset
   178
fun split_tac splits = mktac (map mk_meta_eq splits)
d9edeb96b51c Enforced partial evaluation of mk_case_split_tac.
nipkow
parents: 784
diff changeset
   179
end;
1722
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   180
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   181
local val mktac = mk_case_split_inside_tac meta_iffD
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   182
in
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   183
fun split_inside_tac splits = mktac (map mk_meta_eq splits)
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   184
end;
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   185
4189
b8c7a6bc6c16 added split_prem_tac
oheimb
parents: 4188
diff changeset
   186
val split_prem_tac = mk_case_split_prem_tac split_tac disjE conjE exE contrapos
b8c7a6bc6c16 added split_prem_tac
oheimb
parents: 4188
diff changeset
   187
					    contrapos2 notnotD;
1722
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   188
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   189
(*** Standard simpsets ***)
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   190
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   191
structure Induction = InductionFun(struct val spec=IFOL.spec end);
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   192
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   193
open Simplifier Induction;
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   194
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   195
(*Add congruence rules for = or <-> (instead of ==) *)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   196
infix 4 addcongs delcongs;
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   197
fun ss addcongs congs =
3566
c9c351374651 standard congs;
wenzelm
parents: 3537
diff changeset
   198
        ss addeqcongs (map standard (congs RL [eq_reflection,iff_reflection]));
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   199
fun ss delcongs congs =
3566
c9c351374651 standard congs;
wenzelm
parents: 3537
diff changeset
   200
        ss deleqcongs (map standard (congs RL [eq_reflection,iff_reflection]));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2074
diff changeset
   201
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   202
fun Addcongs congs = (simpset_ref() := simpset() addcongs congs);
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   203
fun Delcongs congs = (simpset_ref() := simpset() delcongs congs);
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   204
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   205
val IFOL_simps =
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   206
   [refl RS P_iff_T] @ conj_simps @ disj_simps @ not_simps @ 
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   207
    imp_simps @ iff_simps @ quant_simps;
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   208
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   209
val notFalseI = int_prove_fun "~False";
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   210
val triv_rls = [TrueI,refl,iff_refl,notFalseI];
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   211
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   212
fun unsafe_solver prems = FIRST'[resolve_tac (triv_rls@prems),
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   213
				 atac, etac FalseE];
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   214
(*No premature instantiation of variables during simplification*)
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   215
fun   safe_solver prems = FIRST'[match_tac (triv_rls@prems),
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   216
				 eq_assume_tac, ematch_tac [FalseE]];
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   217
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   218
(*No simprules, but basic infastructure for simplification*)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   219
val FOL_basic_ss = empty_ss setsubgoaler asm_simp_tac
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   220
			    setSSolver   safe_solver
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   221
			    setSolver  unsafe_solver
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   222
			    setmksimps (map mk_meta_eq o atomize o gen_all);
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   223
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   224
(*intuitionistic simprules only*)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   225
val IFOL_ss = FOL_basic_ss addsimps IFOL_simps
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   226
			   addcongs [imp_cong];
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   227
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   228
val cla_simps = 
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   229
    [de_Morgan_conj, de_Morgan_disj, imp_disj1, imp_disj2,
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   230
     not_all, not_ex, cases_simp] @
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   231
    map prove_fun
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   232
     ["~(P&Q)  <-> ~P | ~Q",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   233
      "P | ~P",             "~P | P",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   234
      "~ ~ P <-> P",        "(~P --> P) <-> P",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   235
      "(~P <-> ~Q) <-> (P<->Q)"];
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   236
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   237
(*classical simprules too*)
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   238
val FOL_ss = IFOL_ss addsimps (cla_simps @ ex_simps @ all_simps);
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   239
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   240
simpset_ref() := FOL_ss;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   241
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   242
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   243
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   244
(*** Integration of simplifier with classical reasoner ***)
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   245
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   246
(* rot_eq_tac rotates the first equality premise of subgoal i to the front,
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   247
   fails if there is no equaliy or if an equality is already at the front *)
3537
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   248
local
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   249
  fun is_eq (Const ("Trueprop", _) $ (Const("op ="  ,_) $ _ $ _)) = true
3537
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   250
    | is_eq (Const ("Trueprop", _) $ (Const("op <->",_) $ _ $ _)) = true
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   251
    | is_eq _ = false;
4188
1025a27b08f9 changed libraray function find to find_index_eq, currying it
oheimb
parents: 4094
diff changeset
   252
  val find_eq = find_index is_eq;
3537
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   253
in
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   254
val rot_eq_tac = 
4188
1025a27b08f9 changed libraray function find to find_index_eq, currying it
oheimb
parents: 4094
diff changeset
   255
     SUBGOAL (fn (Bi,i) => let val n = find_eq (Logic.strip_assums_hyp Bi) in
1025a27b08f9 changed libraray function find to find_index_eq, currying it
oheimb
parents: 4094
diff changeset
   256
		if n>0 then rotate_tac n i else no_tac end)
3537
79ac9b475621 Removal of the tactical STATE
paulson
parents: 3206
diff changeset
   257
end;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   258
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   259
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   260
fun safe_asm_more_full_simp_tac ss = TRY o rot_eq_tac THEN' 
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   261
				     safe_asm_full_simp_tac ss;
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   262
(*an unsatisfactory fix for the incomplete asm_full_simp_tac!
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   263
  better: asm_really_full_simp_tac, a yet to be implemented version of
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   264
			asm_full_simp_tac that applies all equalities in the
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   265
			premises to all the premises *)
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   266
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   267
(*Add a simpset to a classical set!*)
3206
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   268
infix 4 addSss addss;
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   269
fun cs addSss ss = cs addSaltern (CHANGED o (safe_asm_more_full_simp_tac ss));
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   270
fun cs addss  ss = cs addbefore                        asm_full_simp_tac ss;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   271
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   272
fun Addss ss = (claset_ref() := claset() addss ss);
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   273
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   274
(*Designed to be idempotent, except if best_tac instantiates variables
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   275
  in some of the subgoals*)
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   276
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   277
type clasimpset = (claset * simpset);
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   278
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   279
val FOL_css = (FOL_cs, FOL_ss);
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   280
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   281
fun pair_upd1 f ((a,b),x) = (f(a,x), b);
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   282
fun pair_upd2 f ((a,b),x) = (a, f(b,x));
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   283
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   284
infix 4 addSIs2 addSEs2 addSDs2 addIs2 addEs2 addDs2
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   285
	addsimps2 delsimps2 addcongs2 delcongs2;
2727
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   286
fun op addSIs2   arg = pair_upd1 (op addSIs) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   287
fun op addSEs2   arg = pair_upd1 (op addSEs) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   288
fun op addSDs2   arg = pair_upd1 (op addSDs) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   289
fun op addIs2    arg = pair_upd1 (op addIs ) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   290
fun op addEs2    arg = pair_upd1 (op addEs ) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   291
fun op addDs2    arg = pair_upd1 (op addDs ) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   292
fun op addsimps2 arg = pair_upd2 (op addsimps) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   293
fun op delsimps2 arg = pair_upd2 (op delsimps) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   294
fun op addcongs2 arg = pair_upd2 (op addcongs) arg;
230f2643107e Eta-expanded declarations of addSIs2, etc., to avoid polymorphism errors
paulson
parents: 2633
diff changeset
   295
fun op delcongs2 arg = pair_upd2 (op delcongs) arg;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   296
3206
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   297
fun auto_tac (cs,ss) = 
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   298
    let val cs' = cs addss ss 
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   299
    in  EVERY [TRY (safe_tac cs'),
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   300
	       REPEAT (FIRSTGOAL (fast_tac cs')),
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   301
               TRY (safe_tac (cs addSss ss)),
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   302
	       prune_params_tac] 
a3de7f32728c renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents: 2801
diff changeset
   303
    end;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   304
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   305
fun Auto_tac () = auto_tac (claset(), simpset());
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   306
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   307
fun auto () = by (Auto_tac ());