61 (* WHILE *) |
61 (* WHILE *) |
62 by (fast_tac (evalc1_cs addSIs [r_into_rtrancl]) 1); |
62 by (fast_tac (evalc1_cs addSIs [r_into_rtrancl]) 1); |
63 by (fast_tac (evalc1_cs addDs [rtrancl_imp_UN_rel_pow] |
63 by (fast_tac (evalc1_cs addDs [rtrancl_imp_UN_rel_pow] |
64 addIs [rtrancl_into_rtrancl2,lemma1]) 1); |
64 addIs [rtrancl_into_rtrancl2,lemma1]) 1); |
65 |
65 |
66 qed_spec_mp "evalc_impl_evalc1"; |
66 qed "evalc_impl_evalc1"; |
67 |
67 |
68 |
68 |
69 goal Transition.thy |
69 goal Transition.thy |
70 "!c d s u. (c;d,s) -n-> (SKIP,u) --> \ |
70 "!c d s u. (c;d,s) -n-> (SKIP,u) --> \ |
71 \ (? t m. (c,s) -*-> (SKIP,t) & (d,t) -m-> (SKIP,u) & m <= n)"; |
71 \ (? t m. (c,s) -*-> (SKIP,t) & (d,t) -m-> (SKIP,u) & m <= n)"; |
134 by(fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2]) 1); |
134 by(fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2]) 1); |
135 by(fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2]) 1); |
135 by(fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2]) 1); |
136 qed_spec_mp "my_lemma1"; |
136 qed_spec_mp "my_lemma1"; |
137 |
137 |
138 |
138 |
139 goal Transition.thy "!c s s1. <c,s> -c-> s1 --> (c,s) -*-> (SKIP,s1)"; |
139 goal Transition.thy "!!c s s1. <c,s> -c-> s1 ==> (c,s) -*-> (SKIP,s1)"; |
140 br evalc.mutual_induct 1; |
140 be evalc.induct 1; |
141 |
141 |
142 (* SKIP *) |
142 (* SKIP *) |
143 br rtrancl_refl 1; |
143 br rtrancl_refl 1; |
144 |
144 |
145 (* ASSIGN *) |
145 (* ASSIGN *) |
154 |
154 |
155 (* WHILE *) |
155 (* WHILE *) |
156 by (fast_tac (evalc1_cs addSIs [r_into_rtrancl]) 1); |
156 by (fast_tac (evalc1_cs addSIs [r_into_rtrancl]) 1); |
157 by (fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2,my_lemma1]) 1); |
157 by (fast_tac (evalc1_cs addIs [rtrancl_into_rtrancl2,my_lemma1]) 1); |
158 |
158 |
159 qed_spec_mp "evalc_impl_evalc1"; |
159 qed "evalc_impl_evalc1"; |
160 |
160 |
161 (* The opposite direction is based on a Coq proof done by Ranan Fraer and |
161 (* The opposite direction is based on a Coq proof done by Ranan Fraer and |
162 Yves Bertot. The following sketch is from an email by Ranan Fraer. |
162 Yves Bertot. The following sketch is from an email by Ranan Fraer. |
163 *) |
163 *) |
164 (* |
164 (* |
191 while_true. In particular in the case (sequence1) we make use again |
191 while_true. In particular in the case (sequence1) we make use again |
192 of Lemma 1. |
192 of Lemma 1. |
193 *) |
193 *) |
194 |
194 |
195 |
195 |
196 goal Transition.thy "!cs c' s'. (cs -1-> (c',s')) --> (!c s. cs = (c,s) \ |
196 goal Transition.thy |
197 \ --> (!t. <c',s'> -c-> t --> <c,s> -c-> t))"; |
197 "!!c s. ((c,s) -1-> (c',s')) ==> (!t. <c',s'> -c-> t --> <c,s> -c-> t)"; |
198 br evalc1.mutual_induct 1; |
198 be evalc1.induct 1; |
199 by(ALLGOALS(fast_tac (evalc1_cs addEs (evalc_elim_cases@evalc1_elim_cases) |
199 by(ALLGOALS(fast_tac (evalc1_cs addEs (evalc_elim_cases@evalc1_elim_cases) |
200 addss !simpset))); |
200 addss !simpset))); |
201 val lemma = result(); |
201 qed_spec_mp "FB_lemma3"; |
202 |
|
203 val prems = goal Transition.thy |
|
204 "[| ((c,s) -1-> (c',s')); <c',s'> -c-> t |] ==> <c,s> -c-> t"; |
|
205 by(cut_facts_tac (lemma::prems) 1); |
|
206 by(fast_tac HOL_cs 1); |
|
207 qed "FB_lemma3"; |
|
208 |
202 |
209 val [major] = goal Transition.thy |
203 val [major] = goal Transition.thy |
210 "(c,s) -*-> (c',s') ==> <c',s'> -c-> t --> <c,s> -c-> t"; |
204 "(c,s) -*-> (c',s') ==> <c',s'> -c-> t --> <c,s> -c-> t"; |
211 br (major RS rtrancl_induct2) 1; |
205 br (major RS rtrancl_induct2) 1; |
212 by(fast_tac prod_cs 1); |
206 by(fast_tac prod_cs 1); |