| author | obua | 
| Tue, 18 May 2004 10:01:44 +0200 | |
| changeset 14754 | a080eeeaec14 | 
| parent 12218 | 6597093b77e7 | 
| child 14981 | e73f8140af78 | 
| permissions | -rw-r--r-- | 
| 3071 | 1 | (* Title: HOLCF/IOA/meta_theory/RefMappings.ML | 
| 3275 | 2 | ID: $Id$ | 
| 12218 | 3 | Author: Olaf Müller | 
| 4 | License: GPL (GNU GENERAL PUBLIC LICENSE) | |
| 3071 | 5 | |
| 12218 | 6 | Refinement Mappings in HOLCF/IOA. | 
| 3071 | 7 | *) | 
| 8 | ||
| 9 | ||
| 10 | (* ---------------------------------------------------------------------------- *) | |
| 11 | ||
| 12 | section "transitions and moves"; | |
| 13 | ||
| 14 | ||
| 6161 | 15 | Goal "s -a--A-> t ==> ? ex. move A ex s a t"; | 
| 3071 | 16 | |
| 3433 
2de17c994071
added deadlock freedom, polished definitions and proofs
 mueller parents: 
3275diff
changeset | 17 | by (res_inst_tac [("x","(a,t)>>nil")] exI 1);
 | 
| 4098 | 18 | by (asm_full_simp_tac (simpset() addsimps [move_def]) 1); | 
| 3071 | 19 | qed"transition_is_ex"; | 
| 3433 
2de17c994071
added deadlock freedom, polished definitions and proofs
 mueller parents: 
3275diff
changeset | 20 | |
| 3071 | 21 | |
| 6161 | 22 | Goal "(~a:ext A) & s=t ==> ? ex. move A ex s a t"; | 
| 3071 | 23 | |
| 3433 
2de17c994071
added deadlock freedom, polished definitions and proofs
 mueller parents: 
3275diff
changeset | 24 | by (res_inst_tac [("x","nil")] exI 1);
 | 
| 4098 | 25 | by (asm_full_simp_tac (simpset() addsimps [move_def]) 1); | 
| 3071 | 26 | qed"nothing_is_ex"; | 
| 27 | ||
| 28 | ||
| 6161 | 29 | Goal "(s -a--A-> s') & (s' -a'--A-> s'') & (~a':ext A) \ | 
| 3071 | 30 | \ ==> ? ex. move A ex s a s''"; | 
| 31 | ||
| 3433 
2de17c994071
added deadlock freedom, polished definitions and proofs
 mueller parents: 
3275diff
changeset | 32 | by (res_inst_tac [("x","(a,s')>>(a',s'')>>nil")] exI 1);
 | 
| 4098 | 33 | by (asm_full_simp_tac (simpset() addsimps [move_def]) 1); | 
| 3071 | 34 | qed"ei_transitions_are_ex"; | 
| 35 | ||
| 36 | ||
| 6161 | 37 | Goal "(s1 -a1--A-> s2) & (s2 -a2--A-> s3) & (s3 -a3--A-> s4) &\ | 
| 3071 | 38 | \ (~a2:ext A) & (~a3:ext A) ==> \ | 
| 39 | \ ? ex. move A ex s1 a1 s4"; | |
| 40 | ||
| 3433 
2de17c994071
added deadlock freedom, polished definitions and proofs
 mueller parents: 
3275diff
changeset | 41 | by (res_inst_tac [("x","(a1,s2)>>(a2,s3)>>(a3,s4)>>nil")] exI 1);
 | 
| 4098 | 42 | by (asm_full_simp_tac (simpset() addsimps [move_def]) 1); | 
| 3071 | 43 | qed"eii_transitions_are_ex"; | 
| 44 | ||
| 45 | ||
| 46 | (* ---------------------------------------------------------------------------- *) | |
| 47 | ||
| 48 | section "weak_ref_map and ref_map"; | |
| 49 | ||
| 50 | ||
| 5068 | 51 | Goalw [is_weak_ref_map_def,is_ref_map_def] | 
| 6161 | 52 | "[| ext C = ext A; \ | 
| 3071 | 53 | \ is_weak_ref_map f C A |] ==> is_ref_map f C A"; | 
| 54 | by (safe_tac set_cs); | |
| 55 | by (case_tac "a:ext A" 1); | |
| 56 | by (rtac transition_is_ex 1); | |
| 57 | by (Asm_simp_tac 1); | |
| 58 | by (rtac nothing_is_ex 1); | |
| 59 | by (Asm_simp_tac 1); | |
| 60 | qed"weak_ref_map2ref_map"; | |
| 61 | ||
| 62 | ||
| 63 | val prems = goal HOL.thy "(P ==> Q-->R) ==> P&Q --> R"; | |
| 4423 | 64 | by (fast_tac (claset() addDs prems) 1); | 
| 3521 | 65 | val lemma = result(); | 
| 66 | ||
| 6916 | 67 | Delsplits [split_if]; Delcongs [if_weak_cong]; | 
| 68 | ||
| 69 | Goal "[| is_weak_ref_map f C A |] \ | |
| 70 | \ ==> (is_weak_ref_map f (rename C g) (rename A g))"; | |
| 4098 | 71 | by (asm_full_simp_tac (simpset() addsimps [is_weak_ref_map_def]) 1); | 
| 3071 | 72 | by (rtac conjI 1); | 
| 73 | (* 1: start states *) | |
| 4098 | 74 | by (asm_full_simp_tac (simpset() addsimps [rename_def,rename_set_def,starts_of_def]) 1); | 
| 3071 | 75 | (* 2: reachable transitions *) | 
| 76 | by (REPEAT (rtac allI 1)); | |
| 3521 | 77 | by (rtac lemma 1); | 
| 4098 | 78 | by (simp_tac (simpset() addsimps [rename_def,rename_set_def]) 1); | 
| 79 | by (asm_full_simp_tac (simpset() addsimps [externals_def,asig_inputs_def, | |
| 3071 | 80 | asig_outputs_def,asig_of_def,trans_of_def]) 1); | 
| 4423 | 81 | by Safe_tac; | 
| 4833 | 82 | by (stac split_if 1); | 
| 3071 | 83 | by (rtac conjI 1); | 
| 84 | by (rtac impI 1); | |
| 85 | by (etac disjE 1); | |
| 86 | by (etac exE 1); | |
| 87 | by (etac conjE 1); | |
| 88 | (* x is input *) | |
| 89 | by (dtac sym 1); | |
| 90 | by (dtac sym 1); | |
| 91 | by (Asm_full_simp_tac 1); | |
| 92 | by (REPEAT (hyp_subst_tac 1)); | |
| 7499 | 93 | by (ftac reachable_rename 1); | 
| 3071 | 94 | by (Asm_full_simp_tac 1); | 
| 95 | (* x is output *) | |
| 96 | by (etac exE 1); | |
| 97 | by (etac conjE 1); | |
| 98 | by (dtac sym 1); | |
| 99 | by (dtac sym 1); | |
| 100 | by (Asm_full_simp_tac 1); | |
| 101 | by (REPEAT (hyp_subst_tac 1)); | |
| 7499 | 102 | by (ftac reachable_rename 1); | 
| 3071 | 103 | by (Asm_full_simp_tac 1); | 
| 104 | (* x is internal *) | |
| 7499 | 105 | by (ftac reachable_rename 1); | 
| 4477 
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
 paulson parents: 
4423diff
changeset | 106 | by Auto_tac; | 
| 3071 | 107 | qed"rename_through_pmap"; | 
| 6916 | 108 | Addsplits [split_if]; Addcongs [if_weak_cong]; | 
| 3071 | 109 | |
| 110 |