src/FOL/simpdata.ML
author oheimb
Wed, 12 Aug 1998 17:40:18 +0200
changeset 5307 6a699d5cdef4
parent 5304 c133f16febc7
child 5496 42d13691be86
permissions -rw-r--r--
minor adaption for SML/NJ
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
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    44
(*The x=t versions are needed for the simplification procedures*)
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    45
val quant_simps = map int_prove_fun
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    46
 ["(ALL x. P) <-> P",   
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    47
  "(ALL x. x=t --> P(x)) <-> P(t)",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    48
  "(ALL x. t=x --> P(x)) <-> P(t)",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    49
  "(EX x. P) <-> P",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    50
  "(EX x. x=t & P(x)) <-> P(t)", 
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
    51
  "(EX x. t=x & P(x)) <-> P(t)"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
(*These are NOT supplied by default!*)
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
    54
val distrib_simps  = map int_prove_fun
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    55
 ["P & (Q | R) <-> P&Q | P&R", 
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    56
  "(Q | R) & P <-> Q&P | R&P",
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
  "(P | Q --> R) <-> (P --> R) & (Q --> R)"];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    59
(** Conversion into rewrite rules **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
53
f8f37a9a31dc Added gen_all to simpdata.ML.
nipkow
parents: 3
diff changeset
    61
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
    62
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    63
val P_iff_F = int_prove_fun "~P ==> (P <-> False)";
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    64
val iff_reflection_F = P_iff_F RS iff_reflection;
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    65
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    66
val P_iff_T = int_prove_fun "P ==> (P <-> True)";
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    67
val iff_reflection_T = P_iff_T RS iff_reflection;
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    68
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    69
(*Make meta-equalities.  The operator below is Trueprop*)
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    70
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
    71
    Const("==",_)$_$_           => th
432bb9995893 Modified mk_meta_eq to leave meta-equlities on unchanged.
nipkow
parents: 371
diff changeset
    72
  | _ $ (Const("op =",_)$_$_)   => th RS eq_reflection
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    73
  | _ $ (Const("op <->",_)$_$_) => th RS iff_reflection
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    74
  | _ $ (Const("Not",_)$_)      => th RS iff_reflection_F
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
    75
  | _                           => th RS iff_reflection_T;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    77
val mksimps_pairs =
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    78
  [("op -->", [mp]), ("op &", [conjunct1,conjunct2]),
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    79
   ("All", [spec]), ("True", []), ("False", [])];
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    80
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    81
(* FIXME: move to Provers/simplifier.ML
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    82
val mk_atomize:      (string * thm list) list -> thm -> thm list
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    83
*)
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    84
(* FIXME: move to Provers/simplifier.ML*)
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    85
fun mk_atomize pairs =
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    86
  let fun atoms th =
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    87
        (case concl_of th of
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    88
           Const("Trueprop",_) $ p =>
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    89
             (case head_of p of
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    90
                Const(a,_) =>
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    91
                  (case assoc(pairs,a) of
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    92
                     Some(rls) => flat (map atoms ([th] RL rls))
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    93
                   | None => [th])
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    94
              | _ => [th])
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    95
         | _ => [th])
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    96
  in atoms end;
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    97
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
    98
fun mksimps pairs = (map mk_meta_eq o mk_atomize pairs o gen_all);
981
864370666a24 Defined addss to perform simplification in a claset.
lcp
parents: 942
diff changeset
    99
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   100
(*** Classical laws ***)
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
   101
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
fun prove_fun s = 
282
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
   103
 (writeln s;  
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
   104
  prove_goal FOL.thy s
731b27c90d2f FOL/simpdata: tidied
lcp
parents: 215
diff changeset
   105
   (fn prems => [ (cut_facts_tac prems 1), 
1459
d12da312eff4 expanded tabs
clasohm
parents: 1088
diff changeset
   106
                  (Cla.fast_tac FOL_cs 1) ]));
745
45a789407806 added blank line
lcp
parents: 429
diff changeset
   107
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   108
(*Avoids duplication of subgoals after expand_if, when the true and false 
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   109
  cases boil down to the same thing.*) 
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   110
val cases_simp = prove_fun "(P --> Q) & (~P --> Q) <-> Q";
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   111
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   112
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   113
(*** Miniscoping: pushing quantifiers in
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   114
     We do NOT distribute of ALL over &, or dually that of EX over |
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   115
     Baaz and Leitsch, On Skolemization and Proof Complexity (1994) 
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   116
     show that this step can increase proof length!
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   117
***)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   118
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   119
(*existential miniscoping*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   120
val int_ex_simps = map int_prove_fun 
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   121
		     ["(EX x. P(x) & Q) <-> (EX x. P(x)) & Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   122
		      "(EX x. P & Q(x)) <-> P & (EX x. Q(x))",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   123
		      "(EX x. P(x) | Q) <-> (EX x. P(x)) | Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   124
		      "(EX x. P | Q(x)) <-> P | (EX x. Q(x))"];
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   125
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   126
(*classical rules*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   127
val cla_ex_simps = map prove_fun 
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   128
                     ["(EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   129
		      "(EX x. P --> Q(x)) <-> P --> (EX x. Q(x))"];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   131
val ex_simps = int_ex_simps @ cla_ex_simps;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   132
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   133
(*universal miniscoping*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   134
val int_all_simps = map int_prove_fun
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   135
		      ["(ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   136
		       "(ALL x. P & Q(x)) <-> P & (ALL x. Q(x))",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   137
		       "(ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   138
		       "(ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))"];
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   139
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   140
(*classical rules*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   141
val cla_all_simps = map prove_fun
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   142
                      ["(ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q",
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   143
		       "(ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"];
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   144
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   145
val all_simps = int_all_simps @ cla_all_simps;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   146
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   147
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   148
(*** Named rewrite rules proved for IFOL ***)
1953
832ccc1dba95 Introduction of miniscoping for FOL
paulson
parents: 1914
diff changeset
   149
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   150
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
   151
    (fn prems => [ (cut_facts_tac prems 1), 
2601
b301958c465d Renamed structure Int (intuitionistic prover) to IntPr to prevent clash
paulson
parents: 2469
diff changeset
   152
                   (IntPr.fast_tac 1) ]);
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   153
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   154
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
   155
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   156
int_prove "conj_commute" "P&Q <-> Q&P";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   157
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
   158
val conj_comms = [conj_commute, conj_left_commute];
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   159
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   160
int_prove "disj_commute" "P|Q <-> Q|P";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   161
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
   162
val disj_comms = [disj_commute, disj_left_commute];
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   163
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   164
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
   165
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
   166
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   167
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
   168
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
   169
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   170
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
   171
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
   172
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
   173
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   174
prove "imp_disj1" "(P-->Q) | R <-> (P-->Q | R)";
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   175
prove "imp_disj2" "Q | (P-->R) <-> (P-->Q | R)";
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   176
1914
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   177
int_prove "de_Morgan_disj" "(~(P | Q)) <-> (~P & ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   178
prove     "de_Morgan_conj" "(~(P & Q)) <-> (~P | ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   179
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   180
prove     "not_iff" "~(P <-> Q) <-> (P <-> ~Q)";
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   181
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   182
prove     "not_all" "(~ (ALL x. P(x))) <-> (EX x.~P(x))";
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   183
prove     "imp_all" "((ALL x. P(x)) --> Q) <-> (EX x. P(x) --> Q)";
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
   184
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
   185
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
   186
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   187
int_prove "ex_disj_distrib"
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   188
    "(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
   189
int_prove "all_conj_distrib"
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   190
    "(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
   191
86b095835de9 Added a lot of basic laws, from HOL/simpdata
paulson
parents: 1722
diff changeset
   192
1088
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   193
(*Used in ZF, perhaps elsewhere?*)
fc4fb6e8a636 Imported meta_eq_to_obj_eq from HOL for use with 'split'.
lcp
parents: 981
diff changeset
   194
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
   195
  (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
   196
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   197
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   198
(** make simplification procedures for quantifier elimination **)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   199
structure Quantifier1 = Quantifier1Fun(
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   200
struct
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   201
  (*abstract syntax*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   202
  fun dest_eq((c as Const("op =",_)) $ s $ t) = Some(c,s,t)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   203
    | dest_eq _ = None;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   204
  fun dest_conj((c as Const("op &",_)) $ s $ t) = Some(c,s,t)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   205
    | dest_conj _ = None;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   206
  val conj = FOLogic.conj
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   207
  val imp  = FOLogic.imp
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   208
  (*rules*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   209
  val iff_reflection = iff_reflection
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   210
  val iffI = iffI
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   211
  val sym  = sym
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   212
  val conjI= conjI
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   213
  val conjE= conjE
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   214
  val impI = impI
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   215
  val impE = impE
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   216
  val mp   = mp
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   217
  val exI  = exI
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   218
  val exE  = exE
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   219
  val allI = allI
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   220
  val allE = allE
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   221
end);
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   222
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   223
local
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   224
val ex_pattern =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   225
  read_cterm (sign_of FOL.thy) ("EX x. P(x) & Q(x)", FOLogic.oT)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   226
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   227
val all_pattern =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   228
  read_cterm (sign_of FOL.thy) ("ALL x. P(x) & P'(x) --> Q(x)", FOLogic.oT)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   229
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   230
in
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   231
val defEX_regroup =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   232
  mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   233
val defALL_regroup =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   234
  mk_simproc "defined ALL" [all_pattern] Quantifier1.rearrange_all;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   235
end;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   236
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   237
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   238
(*** Case splitting ***)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   240
val meta_eq_to_iff = prove_goal IFOL.thy "x==y ==> x<->y"
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   241
  (fn [prem] => [rewtac prem, rtac iffI 1, atac 1, atac 1]);
1722
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   242
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   243
structure SplitterData =
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   244
  struct
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   245
  structure Simplifier = Simplifier
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   246
  val mk_meta_eq     = mk_meta_eq
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   247
  val meta_eq_to_iff = meta_eq_to_iff
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   248
  val iffD           = iffD2
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   249
  val disjE          = disjE
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   250
  val conjE          = conjE
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   251
  val exE            = exE
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   252
  val contrapos      = contrapos
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   253
  val contrapos2     = contrapos2
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   254
  val notnotD        = notnotD
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   255
  end;
1722
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   256
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   257
structure Splitter = SplitterFun(SplitterData);
1722
bb326972ede6 Added split_inside_tac.
berghofe
parents: 1459
diff changeset
   258
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   259
val split_tac        = Splitter.split_tac;
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   260
val split_inside_tac = Splitter.split_inside_tac;
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   261
val split_asm_tac    = Splitter.split_asm_tac;
5307
6a699d5cdef4 minor adaption for SML/NJ
oheimb
parents: 5304
diff changeset
   262
val op addsplits     = Splitter.addsplits;
6a699d5cdef4 minor adaption for SML/NJ
oheimb
parents: 5304
diff changeset
   263
val op delsplits     = Splitter.delsplits;
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   264
val Addsplits        = Splitter.Addsplits;
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   265
val Delsplits        = Splitter.Delsplits;
4325
e72cba5af6c5 addsplits now in FOL, ZF too
paulson
parents: 4203
diff changeset
   266
e72cba5af6c5 addsplits now in FOL, ZF too
paulson
parents: 4203
diff changeset
   267
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   268
(*** Standard simpsets ***)
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   269
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   270
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
   271
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   272
open Induction;
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   273
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   274
(*Add congruence rules for = or <-> (instead of ==) *)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   275
infix 4 addcongs delcongs;
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   276
fun ss addcongs congs =
3566
c9c351374651 standard congs;
wenzelm
parents: 3537
diff changeset
   277
        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
   278
fun ss delcongs congs =
3566
c9c351374651 standard congs;
wenzelm
parents: 3537
diff changeset
   279
        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
   280
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   281
fun Addcongs congs = (simpset_ref() := simpset() addcongs congs);
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   282
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
   283
5115
caf39b7b7a12 HACKED declaration of addsplits
paulson
parents: 4930
diff changeset
   284
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   285
val IFOL_simps =
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   286
   [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
   287
    imp_simps @ iff_simps @ quant_simps;
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   288
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   289
val notFalseI = int_prove_fun "~False";
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   290
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
   291
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   292
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
   293
				 atac, etac FalseE];
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   294
(*No premature instantiation of variables during simplification*)
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   295
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
   296
				 eq_assume_tac, ematch_tac [FalseE]];
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   297
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   298
(*No simprules, but basic infastructure for simplification*)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   299
val FOL_basic_ss = empty_ss setsubgoaler asm_simp_tac
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   300
                            addsimprocs [defALL_regroup,defEX_regroup]
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   301
			    setSSolver   safe_solver
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   302
			    setSolver  unsafe_solver
5304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   303
			    setmksimps (mksimps mksimps_pairs);
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   304
c133f16febc7 the splitter is now defined as a functor
oheimb
parents: 5220
diff changeset
   305
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   306
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   307
(*intuitionistic simprules only*)
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   308
val IFOL_ss = FOL_basic_ss addsimps (IFOL_simps @ int_ex_simps @ int_all_simps)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   309
			   addcongs [imp_cong];
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   310
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   311
val cla_simps = 
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   312
    [de_Morgan_conj, de_Morgan_disj, imp_disj1, imp_disj2,
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   313
     not_all, not_ex, cases_simp] @
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   314
    map prove_fun
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   315
     ["~(P&Q)  <-> ~P | ~Q",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   316
      "P | ~P",             "~P | P",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   317
      "~ ~ P <-> P",        "(~P --> P) <-> P",
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   318
      "(~P <-> ~Q) <-> (P<->Q)"];
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   319
3910
1cc9b8ab161c New simprules imp_disj1,2 and some comments
paulson
parents: 3835
diff changeset
   320
(*classical simprules too*)
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents: 4325
diff changeset
   321
val FOL_ss = IFOL_ss addsimps (cla_simps @ cla_ex_simps @ cla_all_simps);
2074
30a65172e003 Added the de Morgan laws (incl quantifier versions) to basic simpset
paulson
parents: 2065
diff changeset
   322
4094
9e501199ec01 adapted to new implicit simpset;
wenzelm
parents: 3910
diff changeset
   323
simpset_ref() := FOL_ss;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   324
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   325
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   326
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 5115
diff changeset
   327
(*** integration of simplifier with classical reasoner ***)
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   328
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 5115
diff changeset
   329
structure Clasimp = ClasimpFun
924359415f09 functorized Clasimp module;
wenzelm
parents: 5115
diff changeset
   330
 (structure Simplifier = Simplifier and Classical = Cla and Blast = Blast
5220
07f80f447b27 made SML/NJ happy;
wenzelm
parents: 5219
diff changeset
   331
  val op addcongs = op addcongs and op delcongs = op delcongs
07f80f447b27 made SML/NJ happy;
wenzelm
parents: 5219
diff changeset
   332
  and op addSaltern = op addSaltern and op addbefore = op addbefore);
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 5115
diff changeset
   333
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents: 4649
diff changeset
   334
open Clasimp;
2633
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   335
37c0b5a7ee5d added delcongs, Delcongs, unsafe_solver, safe_solver, FOL_basic_ss,
oheimb
parents: 2601
diff changeset
   336
val FOL_css = (FOL_cs, FOL_ss);