author | wenzelm |
Sun, 21 Oct 2007 16:27:42 +0200 | |
changeset 25135 | 4f8176c940cf |
parent 19741 | f65265d71426 |
child 26306 | ed3375ac152d |
permissions | -rw-r--r-- |
3071 | 1 |
(* Title: HOLCF/IOA/meta_theory/RefMappings.thy |
3275 | 2 |
ID: $Id$ |
12218 | 3 |
Author: Olaf Müller |
3071 | 4 |
*) |
5 |
||
17233 | 6 |
header {* Refinement Mappings in HOLCF/IOA *} |
3071 | 7 |
|
17233 | 8 |
theory RefMappings |
9 |
imports Traces |
|
10 |
begin |
|
11 |
||
12 |
defaultsort type |
|
3071 | 13 |
|
25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
14 |
definition |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
15 |
move :: "[('a,'s)ioa,('a,'s)pairs,'s,'a,'s] => bool" where |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
16 |
"move ioa ex s a t = |
17233 | 17 |
(is_exec_frag ioa (s,ex) & Finite ex & |
18 |
laststate (s,ex)=t & |
|
10835 | 19 |
mk_trace ioa$ex = (if a:ext(ioa) then a>>nil else nil))" |
3071 | 20 |
|
25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
21 |
definition |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
22 |
is_ref_map :: "[('s1=>'s2),('a,'s1)ioa,('a,'s2)ioa] => bool" where |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
23 |
"is_ref_map f C A = |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
24 |
((!s:starts_of(C). f(s):starts_of(A)) & |
17233 | 25 |
(!s t a. reachable C s & |
26 |
s -a--C-> t |
|
25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
27 |
--> (? ex. move A ex (f s) a (f t))))" |
17233 | 28 |
|
25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
29 |
definition |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
30 |
is_weak_ref_map :: "[('s1=>'s2),('a,'s1)ioa,('a,'s2)ioa] => bool" where |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
31 |
"is_weak_ref_map f C A = |
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
32 |
((!s:starts_of(C). f(s):starts_of(A)) & |
17233 | 33 |
(!s t a. reachable C s & |
34 |
s -a--C-> t |
|
35 |
--> (if a:ext(C) |
|
3071 | 36 |
then (f s) -a--A-> (f t) |
25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
19741
diff
changeset
|
37 |
else (f s)=(f t))))" |
3071 | 38 |
|
19741 | 39 |
|
40 |
subsection "transitions and moves" |
|
41 |
||
42 |
||
43 |
lemma transition_is_ex: "s -a--A-> t ==> ? ex. move A ex s a t" |
|
44 |
apply (rule_tac x = " (a,t) >>nil" in exI) |
|
45 |
apply (simp add: move_def) |
|
46 |
done |
|
47 |
||
48 |
||
49 |
lemma nothing_is_ex: "(~a:ext A) & s=t ==> ? ex. move A ex s a t" |
|
50 |
apply (rule_tac x = "nil" in exI) |
|
51 |
apply (simp add: move_def) |
|
52 |
done |
|
53 |
||
54 |
||
55 |
lemma ei_transitions_are_ex: "(s -a--A-> s') & (s' -a'--A-> s'') & (~a':ext A) |
|
56 |
==> ? ex. move A ex s a s''" |
|
57 |
apply (rule_tac x = " (a,s') >> (a',s'') >>nil" in exI) |
|
58 |
apply (simp add: move_def) |
|
59 |
done |
|
60 |
||
61 |
||
62 |
lemma eii_transitions_are_ex: "(s1 -a1--A-> s2) & (s2 -a2--A-> s3) & (s3 -a3--A-> s4) & |
|
63 |
(~a2:ext A) & (~a3:ext A) ==> |
|
64 |
? ex. move A ex s1 a1 s4" |
|
65 |
apply (rule_tac x = " (a1,s2) >> (a2,s3) >> (a3,s4) >>nil" in exI) |
|
66 |
apply (simp add: move_def) |
|
67 |
done |
|
68 |
||
69 |
||
70 |
subsection "weak_ref_map and ref_map" |
|
71 |
||
72 |
lemma imp_conj_lemma: |
|
73 |
"[| ext C = ext A; |
|
74 |
is_weak_ref_map f C A |] ==> is_ref_map f C A" |
|
75 |
apply (unfold is_weak_ref_map_def is_ref_map_def) |
|
76 |
apply (tactic "safe_tac set_cs") |
|
77 |
apply (case_tac "a:ext A") |
|
78 |
apply (rule transition_is_ex) |
|
79 |
apply (simp (no_asm_simp)) |
|
80 |
apply (rule nothing_is_ex) |
|
81 |
apply simp |
|
82 |
done |
|
83 |
||
84 |
||
85 |
lemma imp_conj_lemma: "(P ==> Q-->R) ==> P&Q --> R" |
|
86 |
by blast |
|
87 |
||
88 |
declare split_if [split del] |
|
89 |
declare if_weak_cong [cong del] |
|
90 |
||
91 |
lemma rename_through_pmap: "[| is_weak_ref_map f C A |] |
|
92 |
==> (is_weak_ref_map f (rename C g) (rename A g))" |
|
93 |
apply (simp add: is_weak_ref_map_def) |
|
94 |
apply (rule conjI) |
|
95 |
(* 1: start states *) |
|
96 |
apply (simp add: rename_def rename_set_def starts_of_def) |
|
97 |
(* 2: reachable transitions *) |
|
98 |
apply (rule allI)+ |
|
99 |
apply (rule imp_conj_lemma) |
|
100 |
apply (simp (no_asm) add: rename_def rename_set_def) |
|
101 |
apply (simp add: externals_def asig_inputs_def asig_outputs_def asig_of_def trans_of_def) |
|
102 |
apply safe |
|
103 |
apply (simplesubst split_if) |
|
104 |
apply (rule conjI) |
|
105 |
apply (rule impI) |
|
106 |
apply (erule disjE) |
|
107 |
apply (erule exE) |
|
108 |
apply (erule conjE) |
|
109 |
(* x is input *) |
|
110 |
apply (drule sym) |
|
111 |
apply (drule sym) |
|
112 |
apply simp |
|
113 |
apply hypsubst+ |
|
114 |
apply (frule reachable_rename) |
|
115 |
apply simp |
|
116 |
(* x is output *) |
|
117 |
apply (erule exE) |
|
118 |
apply (erule conjE) |
|
119 |
apply (drule sym) |
|
120 |
apply (drule sym) |
|
121 |
apply simp |
|
122 |
apply hypsubst+ |
|
123 |
apply (frule reachable_rename) |
|
124 |
apply simp |
|
125 |
(* x is internal *) |
|
126 |
apply (frule reachable_rename) |
|
127 |
apply auto |
|
128 |
done |
|
129 |
||
130 |
declare split_if [split] |
|
131 |
declare if_weak_cong [cong] |
|
4559
8e604d885b54
added files containing temproal logic and abstraction;
mueller
parents:
3433
diff
changeset
|
132 |
|
3071 | 133 |
end |