src/HOL/IMP/Equiv.ML
author lcp
Tue, 25 Apr 1995 11:14:03 +0200
changeset 1072 0140ff702b23
parent 1066 ab11d05780f4
child 1266 3ae9fe3c0f68
permissions -rw-r--r--
updated version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     1
(*  Title: 	HOL/IMP/Equiv.ML
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     3
    Author: 	Heiko Loetzbeyer & Robert Sandner, TUM
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1994 TUM
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     5
*)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     6
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     7
goal Equiv.thy "!n. (<a,s> -a-> n) = (n = A a s)";
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     8
by (aexp.induct_tac "a" 1);                		  (* struct. ind. *)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
     9
by (ALLGOALS(simp_tac (HOL_ss addsimps A_simps)));	  (* rewr. Den.   *)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    10
by (TRYALL (fast_tac (set_cs addSIs (evala.intrs@prems)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    11
                             addSEs evala_elim_cases)));
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    12
bind_thm("aexp_iff", result() RS spec);
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    13
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    14
goal Equiv.thy "!w. (<b,s> -b-> w) = (w = B b s)";
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    15
by (bexp.induct_tac "b" 1);
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    16
by (ALLGOALS(asm_simp_tac (HOL_ss addcongs [conj_cong]
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    17
              addsimps (aexp_iff::B_simps@evalb_simps))));
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    18
bind_thm("bexp_iff", result() RS spec);
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    19
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    20
val equiv_cs = comp_cs addss
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    21
                 (prod_ss addsimps (aexp_iff::bexp_iff::evalc.intrs));
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    22
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 924
diff changeset
    23
goal Equiv.thy "!!c. <c,s> -c-> t ==> (s,t) : C(c)";
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    24
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    25
(* start with rule induction *)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    26
be (evalc.mutual_induct RS spec RS spec RS spec RSN (2,rev_mp)) 1;
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    27
by (rewrite_tac (Gamma_def::C_simps));
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    28
  (* simplification with HOL_ss again too agressive *)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    29
(* skip *)
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    30
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    31
(* assign *)
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    32
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    33
(* comp *)
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    34
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    35
(* if *)
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    36
by (fast_tac equiv_cs 1);
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    37
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    38
(* while *)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    39
by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1);
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    40
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    41
by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1);
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    42
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    43
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    44
qed "com1";
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    45
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    46
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    47
goal Equiv.thy "!s t. (s,t):C(c) --> <c,s> -c-> t";
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    48
by (com.induct_tac "c" 1);
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    49
by (rewrite_tac C_simps);
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    50
by (ALLGOALS (TRY o fast_tac equiv_cs));
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    51
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    52
(* while *)
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    53
by (strip_tac 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    54
by (etac (Gamma_mono RSN (2,induct)) 1);
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    55
by (rewrite_goals_tac [Gamma_def]);  
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    56
by (fast_tac equiv_cs 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    57
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    58
bind_thm("com2", result() RS spec RS spec RS mp);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    59
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    60
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    61
(**** Proof of Equivalence ****)
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    62
1066
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    63
goal Equiv.thy "(s,t) : C(c)  =  (<c,s> -c-> t)";
ab11d05780f4 Simplified proofs thanks to addss.
nipkow
parents: 972
diff changeset
    64
by (fast_tac (set_cs addEs [com2] addDs [com1]) 1);
924
806721cfbf46 new version of HOL/IMP with curried function application
clasohm
parents:
diff changeset
    65
qed "com_equivalence";