src/HOL/IOA/ABP/Lemmas.ML
author lcp
Tue, 25 Apr 1995 11:14:03 +0200
changeset 1072 0140ff702b23
parent 1050 0c36c6a52a1d
child 1139 993e475e70e2
permissions -rw-r--r--
updated version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/IOA/ABP/Lemmas.ML
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     2
    ID:         $Id$
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow & Olaf Mueller
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     4
    Copyright   1995  TU Muenchen
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     5
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     6
*)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     7
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     8
(* Logic *)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     9
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    10
val prems = goal HOL.thy "(P ==> Q-->R) ==> P&Q --> R";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    11
  by(fast_tac (HOL_cs addDs prems) 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    12
qed "imp_conj_lemma";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    13
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    14
goal HOL.thy "(~(A&B)) = ((~A)&B| ~B)";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    15
by (fast_tac HOL_cs 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    16
val and_de_morgan_and_absorbe = result();
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    17
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    18
goal HOL.thy "(if C then A else B) --> (A|B)";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    19
by (rtac (expand_if RS ssubst) 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    20
by (fast_tac HOL_cs 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    21
val bool_if_impl_or = result();
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    22
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    23
(* Sets *)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    24
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    25
val set_lemmas =
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    26
   map (fn s => prove_goal Set.thy s (fn _ => [fast_tac set_cs 1]))
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    27
        ["f(x) : (UN x. {f(x)})",
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    28
         "f x y : (UN x y. {f x y})",
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    29
         "!!a. (!x. a ~= f(x)) ==> a ~: (UN x. {f(x)})",
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    30
         "!!a. (!x y. a ~= f x y) ==> a ~: (UN x y. {f x y})"];
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    31
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    32
(* 2 Lemmas to add to set_lemmas ... , used also for action handling, 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    33
   namely for Intersections and the empty list (compatibility of IOA!)  *)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    34
goal Set.thy "(UN b.{x.x=f(b)})= (UN b.{f(b)})"; 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    35
 by (rtac set_ext 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    36
 by (fast_tac set_cs 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    37
val singleton_set =result();
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    38
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    39
goal HOL.thy "((A|B)=False) = ((~A)&(~B))";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    40
 by (fast_tac HOL_cs 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    41
val de_morgan = result();
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    42
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    43
(* Lists *)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    44
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    45
goal List.thy "hd(l@m) = (if l~=[] then hd(l) else hd(m))";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    46
by (List.list.induct_tac "l" 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    47
by (simp_tac list_ss 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    48
by (simp_tac list_ss 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    49
val hd_append =result();
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    50
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    51
goal List.thy "l ~= [] --> (? x xs. l = (x#xs))";
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    52
 by (List.list.induct_tac "l" 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    53
 by (simp_tac list_ss 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    54
 by (fast_tac HOL_cs 1);
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    55
qed"cons_not_nil";