1 |
|
2 AddIs [widen.null]; |
|
3 |
1 |
4 Addsimps [inj_cnam_, inj_vnam_]; |
2 Addsimps [inj_cnam_, inj_vnam_]; |
5 Addsimps [Base_not_Object,Ext_not_Object]; |
3 Addsimps [Base_not_Object,Ext_not_Object]; |
6 Addsimps [Base_not_Object RS not_sym,Ext_not_Object RS not_sym]; |
4 Addsimps [Base_not_Object RS not_sym,Ext_not_Object RS not_sym]; |
7 |
5 |
8 val map_of_Cons = prove_goalw thy [get_def thy "map_of_list"] |
6 bind_thm ("map_of_Cons", hd (tl (thms "map_of.simps"))); |
9 "map_of (p#ps) = (map_of ps)(fst p |-> snd p)" (K [Simp_tac 1]); |
7 Goal "map_of ((aa,bb)#ps) aa = Some bb"; |
10 val map_of_Cons1 = prove_goalw Map.thy [get_def thy "map_of_list"] |
8 by (Simp_tac 1); |
11 "map_of ((x,y)#ps) x = Some y" (K [Simp_tac 1]); |
9 qed "map_of_Cons1"; |
12 val map_of_Cons2 = prove_goalw Map.thy [get_def thy "map_of_list"] |
10 Goal "aa\\<noteq>k ==> map_of ((k,bb)#ps) aa = map_of ps aa"; |
13 "!!X. x\\<noteq>k ==> map_of ((k,y)#ps) x = map_of ps x" (K [Asm_simp_tac 1]); |
11 by (Asm_simp_tac 1); |
|
12 qed "map_of_Cons2"; |
14 Delsimps[map_of_Cons]; (* sic! *) |
13 Delsimps[map_of_Cons]; (* sic! *) |
15 Addsimps[map_of_Cons1, map_of_Cons2]; |
14 Addsimps[map_of_Cons1, map_of_Cons2]; |
16 |
15 |
17 val class_tprg_Object = prove_goalw thy [class_def, ObjectC_def] |
16 Goalw [ObjectC_def] "class tprg Object = Some (arbitrary, [], [])"; |
18 "class tprg Object = Some (None, [], [])" |
17 by (Simp_tac 1); |
19 (K [Simp_tac 1]); |
18 qed "class_tprg_Object"; |
20 val class_tprg_Base = prove_goalw thy [class_def, ObjectC_def, BaseC_def, |
19 |
21 ExtC_def] "class tprg Base = Some (Some Object, \ |
20 Goalw [ObjectC_def, BaseC_def, ExtC_def] "class tprg Base = Some (Object, \ |
22 \ [(vee, PrimT Boolean)], \ |
21 \ [(vee, PrimT Boolean)], \ |
23 \ [((foo, [Class Base]), Class Base, foo_Base)])" (K [ |
22 \ [((foo, [Class Base]), Class Base, foo_Base)])"; |
24 Simp_tac 1]); |
23 by (Simp_tac 1); |
25 val class_tprg_Ext = prove_goalw thy [class_def, ObjectC_def, BaseC_def, |
24 qed "class_tprg_Base"; |
26 ExtC_def] "class tprg Ext = Some (Some Base, \ |
25 |
|
26 Goalw [ObjectC_def, BaseC_def, ExtC_def] "class tprg Ext = Some (Base, \ |
27 \ [(vee, PrimT Integer)], \ |
27 \ [(vee, PrimT Integer)], \ |
28 \ [((foo, [Class Base]), Class Ext, foo_Ext)])" (K [ |
28 \ [((foo, [Class Base]), Class Ext, foo_Ext)])"; |
29 Simp_tac 1]); |
29 by (Simp_tac 1); |
|
30 qed "class_tprg_Ext"; |
|
31 |
30 Addsimps [class_tprg_Object, class_tprg_Base, class_tprg_Ext]; |
32 Addsimps [class_tprg_Object, class_tprg_Base, class_tprg_Ext]; |
31 |
33 |
32 Goal "!!X. (Object,C) \\<in> (subcls1 tprg)^+ ==> R"; |
34 Goal "(Object,C) \\<in> (subcls1 tprg)^+ ==> R"; |
33 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
35 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
34 qed "not_Object_subcls"; |
36 qed "not_Object_subcls"; |
35 AddSEs [not_Object_subcls]; |
37 AddSEs [not_Object_subcls]; |
36 |
38 |
37 Goal "tprg\\<turnstile>Object\\<preceq>C C ==> C = Object"; |
39 Goal "tprg\\<turnstile>Object\\<preceq>C C ==> C = Object"; |
40 bd subcls1D 1; |
42 bd subcls1D 1; |
41 by Auto_tac; |
43 by Auto_tac; |
42 qed "subcls_ObjectD"; |
44 qed "subcls_ObjectD"; |
43 AddSDs[subcls_ObjectD]; |
45 AddSDs[subcls_ObjectD]; |
44 |
46 |
45 Goal "!!X. (Base, Ext) \\<in> (subcls1 tprg)^+ ==> R"; |
47 Goal "(Base, Ext) \\<in> (subcls1 tprg)^+ ==> R"; |
46 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
48 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
47 qed "not_Base_subcls_Ext"; |
49 qed "not_Base_subcls_Ext"; |
48 AddSEs [not_Base_subcls_Ext]; |
50 AddSEs [not_Base_subcls_Ext]; |
49 |
51 |
50 Goalw [class_def, ObjectC_def, BaseC_def, ExtC_def] "class tprg C = Some z ==> C=Object \\<or> C=Base \\<or> C=Ext"; |
52 Goalw [ObjectC_def, BaseC_def, ExtC_def] "class tprg C = Some z ==> C=Object \\<or> C=Base \\<or> C=Ext"; |
51 by (auto_tac (claset(),simpset()addsimps[]addsplits[split_if_asm])); |
53 by (auto_tac (claset(),simpset()addsplits[split_if_asm]addsimps[map_of_Cons])); |
52 qed "class_tprgD"; |
54 qed "class_tprgD"; |
53 |
55 |
54 Goal "(C,C) \\<in> (subcls1 tprg)^+ ==> R"; |
56 Goal "(C,C) \\<in> (subcls1 tprg)^+ ==> R"; |
55 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
57 by (auto_tac (claset() addSDs [tranclD,subcls1D],simpset())); |
56 by (ftac class_tprgD 1); |
58 by (ftac class_tprgD 1); |