src/ZF/simpdata.ML
author wenzelm
Tue Sep 01 22:32:58 2015 +0200 (2015-09-01)
changeset 61076 bdc1e2f0a86a
parent 59582 0fbed69ff081
child 69593 3dda49e08b9d
permissions -rw-r--r--
eliminated \<Colon>;
wenzelm@35762
     1
(*  Title:      ZF/simpdata.ML
clasohm@0
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     3
    Copyright   1991  University of Cambridge
clasohm@0
     4
wenzelm@35762
     5
Rewriting for ZF set theory: specialized extraction of rewrites from theorems.
clasohm@0
     6
*)
clasohm@0
     7
paulson@12199
     8
(*** New version of mk_rew_rules ***)
clasohm@0
     9
clasohm@0
    10
(*Should False yield False<->True, or should it solve goals some other way?*)
clasohm@0
    11
lcp@1036
    12
(*Analyse a theorem to atomic rewrite rules*)
wenzelm@13462
    13
fun atomize (conn_pairs, mem_pairs) th =
lcp@1036
    14
  let fun tryrules pairs t =
clasohm@1461
    15
          case head_of t of
wenzelm@13462
    16
              Const(a,_) =>
haftmann@17325
    17
                (case AList.lookup (op =) pairs a of
wenzelm@32952
    18
                     SOME rls => maps (atomize (conn_pairs, mem_pairs)) ([th] RL rls)
wenzelm@32952
    19
                   | NONE => [th])
clasohm@1461
    20
            | _ => [th]
wenzelm@59582
    21
  in case Thm.concl_of th of
haftmann@38513
    22
         Const(@{const_name Trueprop},_) $ P =>
clasohm@1461
    23
            (case P of
wenzelm@24826
    24
                 Const(@{const_name mem},_) $ a $ b => tryrules mem_pairs b
haftmann@38513
    25
               | Const(@{const_name True},_)         => []
haftmann@38513
    26
               | Const(@{const_name False},_)        => []
clasohm@1461
    27
               | A => tryrules conn_pairs A)
lcp@1036
    28
       | _                       => [th]
lcp@1036
    29
  end;
lcp@1036
    30
clasohm@0
    31
(*Analyse a rigid formula*)
lcp@1036
    32
val ZF_conn_pairs =
haftmann@38513
    33
  [(@{const_name Ball}, [@{thm bspec}]),
haftmann@38513
    34
   (@{const_name All}, [@{thm spec}]),
wenzelm@41310
    35
   (@{const_name imp}, [@{thm mp}]),
wenzelm@41310
    36
   (@{const_name conj}, [@{thm conjunct1}, @{thm conjunct2}])];
clasohm@0
    37
clasohm@0
    38
(*Analyse a:b, where b is rigid*)
wenzelm@13462
    39
val ZF_mem_pairs =
haftmann@38513
    40
  [(@{const_name Collect}, [@{thm CollectD1}, @{thm CollectD2}]),
haftmann@38513
    41
   (@{const_name Diff}, [@{thm DiffD1}, @{thm DiffD2}]),
haftmann@38513
    42
   (@{const_name Int}, [@{thm IntD1}, @{thm IntD2}])];
clasohm@0
    43
lcp@1036
    44
val ZF_atomize = atomize (ZF_conn_pairs, ZF_mem_pairs);
lcp@1036
    45