7 goal Equiv.thy "!n. (<a,s> -a-> n) = (n = A(a,s))"; |
7 goal Equiv.thy "!n. (<a,s> -a-> n) = (n = A(a,s))"; |
8 by (aexp.induct_tac "a" 1); (* struct. ind. *) |
8 by (aexp.induct_tac "a" 1); (* struct. ind. *) |
9 by (ALLGOALS(simp_tac (HOL_ss addsimps A_simps))); (* rewr. Den. *) |
9 by (ALLGOALS(simp_tac (HOL_ss addsimps A_simps))); (* rewr. Den. *) |
10 by (TRYALL (fast_tac (set_cs addSIs (evala.intrs@prems) |
10 by (TRYALL (fast_tac (set_cs addSIs (evala.intrs@prems) |
11 addSEs evala_elim_cases))); |
11 addSEs evala_elim_cases))); |
12 val aexp_iff = result() RS spec; |
12 val aexp_iff = store_thm("aexp_iff", result() RS spec); |
13 |
13 |
14 |
14 |
15 goal HOL.thy "(? x. x=t & P) = P"; |
15 goal HOL.thy "(? x. x=t & P) = P"; |
16 by(fast_tac HOL_cs 1); |
16 by(fast_tac HOL_cs 1); |
17 val elim_ex_conv = result(); |
17 qed "elim_ex_conv"; |
18 |
18 |
19 goal Equiv.thy "!w. (<b,s> -b-> w) = (w = B(b,s))"; |
19 goal Equiv.thy "!w. (<b,s> -b-> w) = (w = B(b,s))"; |
20 by (bexp.induct_tac "b" 1); |
20 by (bexp.induct_tac "b" 1); |
21 by (ALLGOALS(asm_simp_tac (HOL_ss addcongs [conj_cong] |
21 by (ALLGOALS(asm_simp_tac (HOL_ss addcongs [conj_cong] |
22 addsimps (aexp_iff::elim_ex_conv::B_simps@evalb_simps)))); |
22 addsimps (aexp_iff::elim_ex_conv::B_simps@evalb_simps)))); |
23 val bexp_iff = result() RS spec; |
23 val bexp_iff = store_thm("bexp_iff", result() RS spec); |
24 |
24 |
25 val bexp1 = bexp_iff RS iffD1; |
25 val bexp1 = bexp_iff RS iffD1; |
26 val bexp2 = bexp_iff RS iffD2; |
26 val bexp2 = bexp_iff RS iffD2; |
27 |
27 |
28 val BfstI = read_instantiate_sg (sign_of Equiv.thy) |
28 val BfstI = read_instantiate_sg (sign_of Equiv.thy) |
49 by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1); |
49 by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1); |
50 by (fast_tac (comp_cs addSIs [bexp1,BfstI] addSDs [BfstD,bexp1]) 1); |
50 by (fast_tac (comp_cs addSIs [bexp1,BfstI] addSDs [BfstD,bexp1]) 1); |
51 by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1); |
51 by (rtac (rewrite_rule [Gamma_def] (Gamma_mono RS lfp_Tarski RS ssubst)) 1); |
52 by (fast_tac (comp_cs addSIs [bexp1,BfstI] addSDs [BfstD,bexp1]) 1); |
52 by (fast_tac (comp_cs addSIs [bexp1,BfstI] addSDs [BfstD,bexp1]) 1); |
53 |
53 |
54 val com1 = result(); |
54 qed "com1"; |
55 |
55 |
56 |
56 |
57 val com_ss = prod_ss addsimps (aexp_iff::bexp_iff::evalc.intrs); |
57 val com_ss = prod_ss addsimps (aexp_iff::bexp_iff::evalc.intrs); |
58 |
58 |
59 goal Equiv.thy "!io:C(c). <c,fst(io)> -c-> snd(io)"; |
59 goal Equiv.thy "!io:C(c). <c,fst(io)> -c-> snd(io)"; |
71 by (rewrite_goals_tac [Gamma_def]); |
71 by (rewrite_goals_tac [Gamma_def]); |
72 by (safe_tac comp_cs); |
72 by (safe_tac comp_cs); |
73 by (EVERY1 [dtac bspec, atac]); |
73 by (EVERY1 [dtac bspec, atac]); |
74 by (ALLGOALS (asm_full_simp_tac com_ss)); |
74 by (ALLGOALS (asm_full_simp_tac com_ss)); |
75 |
75 |
76 val com2 = result(); |
76 qed "com2"; |
77 |
77 |
78 |
78 |
79 (**** Proof of Equivalence ****) |
79 (**** Proof of Equivalence ****) |
80 |
80 |
81 val com_iff_cs = set_cs addEs [com2 RS bspec] addDs [com1]; |
81 val com_iff_cs = set_cs addEs [com2 RS bspec] addDs [com1]; |