163 |
163 |
164 definition addition_LE :: "(((nat \<times> nat list) \<times> nat \<times> nat) \<times> |
164 definition addition_LE :: "(((nat \<times> nat list) \<times> nat \<times> nat) \<times> |
165 ((nat \<times> nat list) \<times> nat \<times> nat)) set" |
165 ((nat \<times> nat list) \<times> nat \<times> nat)) set" |
166 where "addition_LE \<equiv> (inv_image lex_triple addition_measure)" |
166 where "addition_LE \<equiv> (inv_image lex_triple addition_measure)" |
167 |
167 |
168 lemma [simp]: "wf addition_LE" |
168 lemma wf_additon_LE[simp]: "wf addition_LE" |
169 by(auto simp: wf_inv_image addition_LE_def lex_triple_def |
169 by(auto simp: addition_LE_def lex_triple_def lex_pair_def) |
170 lex_pair_def) |
|
171 |
170 |
172 declare addition_inv.simps[simp del] |
171 declare addition_inv.simps[simp del] |
173 |
172 |
174 lemma addition_inv_init: |
173 lemma addition_inv_init: |
175 "\<lbrakk>m \<noteq> n; max m n < p; length lm > p; lm ! p = 0\<rbrakk> \<Longrightarrow> |
174 "\<lbrakk>m \<noteq> n; max m n < p; length lm > p; lm ! p = 0\<rbrakk> \<Longrightarrow> |
176 addition_inv (0, lm) m n p lm" |
175 addition_inv (0, lm) m n p lm" |
177 apply(simp add: addition_inv.simps Let_def) |
176 apply(simp add: addition_inv.simps Let_def) |
178 apply(rule_tac x = "lm ! m" in exI, simp) |
177 apply(rule_tac x = "lm ! m" in exI, simp) |
179 done |
178 done |
180 |
179 |
181 lemma [simp]: "abc_fetch 0 (addition m n p) = Some (Dec m 4)" |
180 lemma abs_fetch_0[simp]: "abc_fetch 0 (addition m n p) = Some (Dec m 4)" |
182 by(simp add: abc_fetch.simps addition.simps) |
181 by(simp add: abc_fetch.simps addition.simps) |
183 |
182 |
184 lemma [simp]: "abc_fetch (Suc 0) (addition m n p) = Some (Inc n)" |
183 lemma abs_fetch_1[simp]: "abc_fetch (Suc 0) (addition m n p) = Some (Inc n)" |
185 by(simp add: abc_fetch.simps addition.simps) |
184 by(simp add: abc_fetch.simps addition.simps) |
186 |
185 |
187 lemma [simp]: "abc_fetch 2 (addition m n p) = Some (Inc p)" |
186 lemma abs_fetch_2[simp]: "abc_fetch 2 (addition m n p) = Some (Inc p)" |
188 by(simp add: abc_fetch.simps addition.simps) |
187 by(simp add: abc_fetch.simps addition.simps) |
189 |
188 |
190 lemma [simp]: "abc_fetch 3 (addition m n p) = Some (Goto 0)" |
189 lemma abs_fetch_3[simp]: "abc_fetch 3 (addition m n p) = Some (Goto 0)" |
191 by(simp add: abc_fetch.simps addition.simps) |
190 by(simp add: abc_fetch.simps addition.simps) |
192 |
191 |
193 lemma [simp]: "abc_fetch 4 (addition m n p) = Some (Dec p 7)" |
192 lemma abs_fetch_4[simp]: "abc_fetch 4 (addition m n p) = Some (Dec p 7)" |
194 by(simp add: abc_fetch.simps addition.simps) |
193 by(simp add: abc_fetch.simps addition.simps) |
195 |
194 |
196 lemma [simp]: "abc_fetch 5 (addition m n p) = Some (Inc m)" |
195 lemma abs_fetch_5[simp]: "abc_fetch 5 (addition m n p) = Some (Inc m)" |
197 by(simp add: abc_fetch.simps addition.simps) |
196 by(simp add: abc_fetch.simps addition.simps) |
198 |
197 |
199 lemma [simp]: "abc_fetch 6 (addition m n p) = Some (Goto 4)" |
198 lemma abs_fetch_6[simp]: "abc_fetch 6 (addition m n p) = Some (Goto 4)" |
200 by(simp add: abc_fetch.simps addition.simps) |
199 by(simp add: abc_fetch.simps addition.simps) |
201 |
200 |
202 lemma [simp]: |
201 lemma exists_small_list_elem1[simp]: |
203 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x \<le> lm ! m; 0 < x\<rbrakk> |
202 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x \<le> lm ! m; 0 < x\<rbrakk> |
204 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
203 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
205 p := lm ! m - x, m := x - Suc 0] = |
204 p := lm ! m - x, m := x - Suc 0] = |
206 lm[m := xa, n := lm ! n + lm ! m - Suc xa, |
205 lm[m := xa, n := lm ! n + lm ! m - Suc xa, |
207 p := lm ! m - Suc xa]" |
206 p := lm ! m - Suc xa]" |
208 apply(case_tac x, simp, simp) |
207 apply(case_tac x, simp, simp) |
209 apply(rule_tac x = nat in exI, simp add: list_update_swap |
208 apply(rule_tac x = nat in exI, simp add: list_update_swap |
210 list_update_overwrite) |
209 list_update_overwrite) |
211 done |
210 done |
212 |
211 |
213 lemma [simp]: |
212 lemma exists_small_list_elem2[simp]: |
214 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
213 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
215 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - Suc x, |
214 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - Suc x, |
216 p := lm ! m - Suc x, n := lm ! n + lm ! m - x] |
215 p := lm ! m - Suc x, n := lm ! n + lm ! m - x] |
217 = lm[m := xa, n := lm ! n + lm ! m - xa, |
216 = lm[m := xa, n := lm ! n + lm ! m - xa, |
218 p := lm ! m - Suc xa]" |
217 p := lm ! m - Suc xa]" |
219 apply(rule_tac x = x in exI, |
218 apply(rule_tac x = x in exI, |
220 simp add: list_update_swap list_update_overwrite) |
219 simp add: list_update_swap list_update_overwrite) |
221 done |
220 done |
222 |
221 |
223 lemma [simp]: |
222 lemma exists_small_list_elem3[simp]: |
224 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
223 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
225 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
224 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
226 p := lm ! m - Suc x, p := lm ! m - x] |
225 p := lm ! m - Suc x, p := lm ! m - x] |
227 = lm[m := xa, n := lm ! n + lm ! m - xa, |
226 = lm[m := xa, n := lm ! n + lm ! m - xa, |
228 p := lm ! m - xa]" |
227 p := lm ! m - xa]" |
229 apply(rule_tac x = x in exI, simp add: list_update_overwrite) |
228 apply(rule_tac x = x in exI, simp add: list_update_overwrite) |
230 done |
229 done |
231 |
230 |
232 lemma [simp]: |
231 lemma exists_small_list_elem4[simp]: |
233 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = (0::nat); m < p; n < p; x < lm ! m\<rbrakk> |
232 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = (0::nat); m < p; n < p; x < lm ! m\<rbrakk> |
234 \<Longrightarrow> \<exists>xa\<le>lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
233 \<Longrightarrow> \<exists>xa\<le>lm ! m. lm[m := x, n := lm ! n + lm ! m - x, |
235 p := lm ! m - x] = |
234 p := lm ! m - x] = |
236 lm[m := xa, n := lm ! n + lm ! m - xa, |
235 lm[m := xa, n := lm ! n + lm ! m - xa, |
237 p := lm ! m - xa]" |
236 p := lm ! m - xa]" |
238 apply(rule_tac x = x in exI, simp) |
237 apply(rule_tac x = x in exI, simp) |
239 done |
238 done |
240 |
239 |
241 lemma [simp]: |
240 lemma exists_small_list_elem5[simp]: |
242 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; |
241 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; |
243 x \<le> lm ! m; lm ! m \<noteq> x\<rbrakk> |
242 x \<le> lm ! m; lm ! m \<noteq> x\<rbrakk> |
244 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m, |
243 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m, |
245 p := lm ! m - x, p := lm ! m - Suc x] |
244 p := lm ! m - x, p := lm ! m - Suc x] |
246 = lm[m := xa, n := lm ! n + lm ! m, |
245 = lm[m := xa, n := lm ! n + lm ! m, |
247 p := lm ! m - Suc xa]" |
246 p := lm ! m - Suc xa]" |
248 apply(rule_tac x = x in exI, simp add: list_update_overwrite) |
247 apply(rule_tac x = x in exI, simp add: list_update_overwrite) |
249 done |
248 done |
250 |
249 |
251 lemma [simp]: |
250 lemma exists_small_list_elem6[simp]: |
252 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
251 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
253 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m, |
252 \<Longrightarrow> \<exists>xa<lm ! m. lm[m := x, n := lm ! n + lm ! m, |
254 p := lm ! m - Suc x, m := Suc x] |
253 p := lm ! m - Suc x, m := Suc x] |
255 = lm[m := Suc xa, n := lm ! n + lm ! m, |
254 = lm[m := Suc xa, n := lm ! n + lm ! m, |
256 p := lm ! m - Suc xa]" |
255 p := lm ! m - Suc xa]" |
257 apply(rule_tac x = x in exI, |
256 apply(rule_tac x = x in exI, |
258 simp add: list_update_swap list_update_overwrite) |
257 simp add: list_update_swap list_update_overwrite) |
259 done |
258 done |
260 |
259 |
261 lemma [simp]: |
260 lemma exists_small_list_elem7[simp]: |
262 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
261 "\<lbrakk>m \<noteq> n; p < length lm; lm ! p = 0; m < p; n < p; x < lm ! m\<rbrakk> |
263 \<Longrightarrow> \<exists>xa\<le>lm ! m. lm[m := Suc x, n := lm ! n + lm ! m, |
262 \<Longrightarrow> \<exists>xa\<le>lm ! m. lm[m := Suc x, n := lm ! n + lm ! m, |
264 p := lm ! m - Suc x] |
263 p := lm ! m - Suc x] |
265 = lm[m := xa, n := lm ! n + lm ! m, p := lm ! m - xa]" |
264 = lm[m := xa, n := lm ! n + lm ! m, p := lm ! m - xa]" |
266 apply(rule_tac x = "Suc x" in exI, simp) |
265 apply(rule_tac x = "Suc x" in exI, simp) |
478 apply(simp add: abc_steps_l.simps mv_box_inv.simps) |
477 apply(simp add: abc_steps_l.simps mv_box_inv.simps) |
479 apply(rule_tac x = "initlm ! m" in exI, |
478 apply(rule_tac x = "initlm ! m" in exI, |
480 rule_tac x = "initlm ! n" in exI, simp) |
479 rule_tac x = "initlm ! n" in exI, simp) |
481 done |
480 done |
482 |
481 |
483 lemma [simp]: "abc_fetch 0 (mv_box m n) = Some (Dec m 3)" |
482 lemma abc_fetch_0[simp]: "abc_fetch 0 (mv_box m n) = Some (Dec m 3)" |
484 apply(simp add: mv_box.simps abc_fetch.simps) |
483 apply(simp add: mv_box.simps abc_fetch.simps) |
485 done |
484 done |
486 |
485 |
487 lemma [simp]: "abc_fetch (Suc 0) (mv_box m n) = |
486 lemma abc_fetch_1[simp]: "abc_fetch (Suc 0) (mv_box m n) = |
488 Some (Inc n)" |
487 Some (Inc n)" |
489 apply(simp add: mv_box.simps abc_fetch.simps) |
488 apply(simp add: mv_box.simps abc_fetch.simps) |
490 done |
489 done |
491 |
490 |
492 lemma [simp]: "abc_fetch 2 (mv_box m n) = Some (Goto 0)" |
491 lemma abc_fetch_2[simp]: "abc_fetch 2 (mv_box m n) = Some (Goto 0)" |
493 apply(simp add: mv_box.simps abc_fetch.simps) |
492 apply(simp add: mv_box.simps abc_fetch.simps) |
494 done |
493 done |
495 |
494 |
496 lemma [simp]: "abc_fetch 3 (mv_box m n) = None" |
495 lemma abc_fetch_3[simp]: "abc_fetch 3 (mv_box m n) = None" |
497 apply(simp add: mv_box.simps abc_fetch.simps) |
496 apply(simp add: mv_box.simps abc_fetch.simps) |
498 done |
497 done |
499 |
498 |
500 lemma replicate_Suc_iff_anywhere: "x # x\<up>b @ ys = x\<up>(Suc b) @ ys" |
499 lemma replicate_Suc_iff_anywhere: "x # x\<up>b @ ys = x\<up>(Suc b) @ ys" |
501 by simp |
500 by simp |
502 |
501 |
503 lemma [simp]: |
502 lemma exists_smaller_in_list0[simp]: |
504 "\<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; |
503 "\<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; |
505 k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk> |
504 k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk> |
506 \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, m := k - Suc 0] = |
505 \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, m := k - Suc 0] = |
507 initlm[m := ka, n := la] \<and> |
506 initlm[m := ka, n := la] \<and> |
508 Suc (ka + la) = initlm ! m + initlm ! n \<and> |
507 Suc (ka + la) = initlm ! m + initlm ! n \<and> |
515 apply(simp add: list_update_overwrite ) |
514 apply(simp add: list_update_overwrite ) |
516 apply(simp add: list_update_swap) |
515 apply(simp add: list_update_swap) |
517 apply(simp add: list_update_swap) |
516 apply(simp add: list_update_swap) |
518 done |
517 done |
519 |
518 |
520 lemma [simp]: |
519 lemma exists_smaller_in_list1[simp]: |
521 "\<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; |
520 "\<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; |
522 Suc (k + l) = initlm ! m + initlm ! n; |
521 Suc (k + l) = initlm ! m + initlm ! n; |
523 k < initlm ! m\<rbrakk> |
522 k < initlm ! m\<rbrakk> |
524 \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, n := Suc l] = |
523 \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, n := Suc l] = |
525 initlm[m := ka, n := la] \<and> |
524 initlm[m := ka, n := la] \<and> |
526 ka + la = initlm ! m + initlm ! n \<and> |
525 ka + la = initlm ! m + initlm ! n \<and> |
527 ka \<le> initlm ! m" |
526 ka \<le> initlm ! m" |
528 apply(rule_tac x = k in exI, rule_tac x = "Suc l" in exI, auto) |
527 apply(rule_tac x = k in exI, rule_tac x = "Suc l" in exI, auto) |
529 done |
528 done |
530 |
529 |
531 lemma [simp]: |
530 lemma abc_steps_prop[simp]: |
532 "\<lbrakk>length initlm > max m n; m \<noteq> n\<rbrakk> \<Longrightarrow> |
531 "\<lbrakk>length initlm > max m n; m \<noteq> n\<rbrakk> \<Longrightarrow> |
533 \<forall>na. \<not> (\<lambda>(as, lm) m. as = 3) |
532 \<forall>na. \<not> (\<lambda>(as, lm) m. as = 3) |
534 (abc_steps_l (0, initlm) (mv_box m n) na) m \<and> |
533 (abc_steps_l (0, initlm) (mv_box m n) na) m \<and> |
535 mv_box_inv (abc_steps_l (0, initlm) |
534 mv_box_inv (abc_steps_l (0, initlm) |
536 (mv_box m n) na) m n initlm \<longrightarrow> |
535 (mv_box m n) na) m n initlm \<longrightarrow> |
794 apply(simp, insert g) |
794 apply(simp, insert g) |
795 apply(simp add: nth_append) |
795 apply(simp add: nth_append) |
796 done |
796 done |
797 qed |
797 qed |
798 |
798 |
799 lemma [simp]: "length lm1 = aa \<Longrightarrow> |
799 lemma butlast_last[simp]: "length lm1 = aa \<Longrightarrow> |
800 (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ 0 # lm4) ! (aa + n) = last lm2" |
800 (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ 0 # lm4) ! (aa + n) = last lm2" |
801 apply(simp add: nth_append) |
801 apply(simp add: nth_append) |
802 done |
802 done |
803 |
803 |
804 lemma [simp]: "\<lbrakk>Suc n \<le> ba - aa; aa < ba\<rbrakk> \<Longrightarrow> |
804 lemma arith_as_simp[simp]: "\<lbrakk>Suc n \<le> ba - aa; aa < ba\<rbrakk> \<Longrightarrow> |
805 (ba < Suc (aa + (ba - Suc (aa + n) + n))) = False" |
805 (ba < Suc (aa + (ba - Suc (aa + n) + n))) = False" |
806 apply arith |
806 apply arith |
807 done |
807 done |
808 |
808 |
809 lemma [simp]: "\<lbrakk>Suc n \<le> ba - aa; aa < ba; length lm1 = aa; |
809 lemma butlast_elem[simp]: "\<lbrakk>Suc n \<le> ba - aa; aa < ba; length lm1 = aa; |
810 length lm2 = Suc n; length lm3 = ba - Suc (aa + n)\<rbrakk> |
810 length lm2 = Suc n; length lm3 = ba - Suc (aa + n)\<rbrakk> |
811 \<Longrightarrow> (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ 0 # lm4) ! (ba + n) = 0" |
811 \<Longrightarrow> (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ 0 # lm4) ! (ba + n) = 0" |
812 using nth_append[of "lm1 @ (0\<Colon>'a)\<up>n @ last lm2 # lm3 @ butlast lm2" |
812 using nth_append[of "lm1 @ (0::'a)\<up>n @ last lm2 # lm3 @ butlast lm2" |
813 "(0\<Colon>'a) # lm4" "ba + n"] |
813 "(0::'a) # lm4" "ba + n"] |
814 apply(simp) |
814 apply(simp) |
815 done |
815 done |
816 |
816 |
817 lemma [simp]: |
817 lemma update_butlast_eq0[simp]: |
818 "\<lbrakk>Suc n \<le> ba - aa; aa < ba; length lm1 = aa; length lm2 = Suc n; |
818 "\<lbrakk>Suc n \<le> ba - aa; aa < ba; length lm1 = aa; length lm2 = Suc n; |
819 length lm3 = ba - Suc (aa + n)\<rbrakk> |
819 length lm3 = ba - Suc (aa + n)\<rbrakk> |
820 \<Longrightarrow> (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ (0::nat) # lm4) |
820 \<Longrightarrow> (lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2 @ (0::nat) # lm4) |
821 [ba + n := last lm2, aa + n := 0] = |
821 [ba + n := last lm2, aa + n := 0] = |
822 lm1 @ 0 # 0\<up>n @ lm3 @ lm2 @ lm4" |
822 lm1 @ 0 # 0\<up>n @ lm3 @ lm2 @ lm4" |
823 using list_update_append[of "lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2" "0 # lm4" |
823 using list_update_append[of "lm1 @ 0\<up>n @ last lm2 # lm3 @ butlast lm2" "0 # lm4" |
824 "ba + n" "last lm2"] |
824 "ba + n" "last lm2"] |
825 apply(simp) |
825 apply(simp add: list_update_append list_update.simps(2-) replicate_Suc_iff_anywhere exp_suc |
826 apply(simp add: list_update_append list_update.simps replicate_Suc_iff_anywhere exp_suc |
826 del: replicate_Suc) |
827 del: replicate_Suc) |
|
828 apply(case_tac lm2, simp, simp) |
827 apply(case_tac lm2, simp, simp) |
829 done |
828 done |
830 |
829 |
831 lemma [simp]: |
830 lemma update_butlast_eq1[simp]: |
832 "\<lbrakk>Suc (length lm1 + n) \<le> ba; length lm2 = Suc n; length lm3 = ba - Suc (length lm1 + n); |
831 "\<lbrakk>Suc (length lm1 + n) \<le> ba; length lm2 = Suc n; length lm3 = ba - Suc (length lm1 + n); |
833 \<not> ba - Suc (length lm1) < ba - Suc (length lm1 + n); \<not> ba + n - length lm1 < n\<rbrakk> |
832 \<not> ba - Suc (length lm1) < ba - Suc (length lm1 + n); \<not> ba + n - length lm1 < n\<rbrakk> |
834 \<Longrightarrow> (0::nat) \<up> n @ (last lm2 # lm3 @ butlast lm2 @ 0 # lm4)[ba - length lm1 := last lm2, 0 := 0] = |
833 \<Longrightarrow> (0::nat) \<up> n @ (last lm2 # lm3 @ butlast lm2 @ 0 # lm4)[ba - length lm1 := last lm2, 0 := 0] = |
835 0 # 0 \<up> n @ lm3 @ lm2 @ lm4" |
834 0 # 0 \<up> n @ lm3 @ lm2 @ lm4" |
836 apply(subgoal_tac "ba - length lm1 = Suc n + length lm3", simp add: list_update.simps list_update_append) |
835 apply(subgoal_tac "ba - length lm1 = Suc n + length lm3", simp add: list_update.simps(2-) list_update_append) |
837 apply(simp add: replicate_Suc_iff_anywhere exp_suc del: replicate_Suc) |
836 apply(simp add: replicate_Suc_iff_anywhere exp_suc del: replicate_Suc) |
838 apply(case_tac lm2, simp, simp) |
837 apply(case_tac lm2, simp, simp) |
839 apply(auto) |
838 apply(auto) |
840 done |
839 done |
841 |
840 |
1689 ultimately show "?thesis" |
1685 ultimately show "?thesis" |
1690 using code ft |
1686 using code ft |
1691 by(auto, rule_tac x = "stp + stpa" in exI, simp add: abc_steps_add replicate_Suc_iff_anywhere del: replicate_Suc) |
1687 by(auto, rule_tac x = "stp + stpa" in exI, simp add: abc_steps_add replicate_Suc_iff_anywhere del: replicate_Suc) |
1692 qed |
1688 qed |
1693 |
1689 |
1694 lemma [simp]: |
1690 lemma abc_lm_s_simp0[simp]: |
1695 "length xs = n \<Longrightarrow> abc_lm_s (xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) |
1691 "length xs = n \<Longrightarrow> abc_lm_s (xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) |
1696 (max fft gft) - Suc (Suc n)) @ 0 # anything) (max (n + 3) (max fft gft)) 0 = |
1692 (max fft gft) - Suc (Suc n)) @ 0 # anything) (max (n + 3) (max fft gft)) 0 = |
1697 xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) (max fft gft) - Suc n) @ anything" |
1693 xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) (max fft gft) - Suc n) @ anything" |
1698 apply(simp add: abc_lm_s.simps) |
1694 apply(simp add: abc_lm_s.simps) |
1699 using list_update_length[of "xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) (max fft gft) - Suc (Suc n))" |
1695 using list_update_length[of "xs @ x # rec_exec (Pr n f g) (xs @ [x]) # 0 \<up> (max (n + 3) (max fft gft) - Suc (Suc n))" |
1700 0 anything 0] |
1696 0 anything 0] |
1701 apply(auto simp: Suc_diff_Suc) |
1697 apply(auto simp: Suc_diff_Suc) |
1702 apply(simp add: exp_suc[THEN sym] Suc_diff_Suc del: replicate_Suc) |
1698 apply(simp add: exp_suc[THEN sym] Suc_diff_Suc del: replicate_Suc) |
1703 done |
1699 done |
1704 |
1700 |
1705 lemma [simp]: |
1701 lemma index_at_zero_elem[simp]: |
1706 "(xs @ x # rec_exec (Pr (length xs) f g) (xs @ [x]) # 0 \<up> (max (length xs + 3) |
1702 "(xs @ x # re # 0 \<up> (max (length xs + 3) |
1707 (max fft gft) - Suc (Suc (length xs))) @ 0 # anything) ! |
1703 (max fft gft) - Suc (Suc (length xs))) @ 0 # anything) ! |
1708 max (length xs + 3) (max fft gft) = 0" |
1704 max (length xs + 3) (max fft gft) = 0" |
1709 using nth_append_length[of "xs @ x # rec_exec (Pr (length xs) f g) (xs @ [x]) # |
1705 using nth_append_length[of "xs @ x # re # |
1710 0 \<up> (max (length xs + 3) (max fft gft) - Suc (Suc (length xs)))" 0 anything] |
1706 0 \<up> (max (length xs + 3) (max fft gft) - Suc (Suc (length xs)))" 0 anything] |
1711 by(simp) |
1707 by(simp) |
1712 |
1708 |
1713 lemma pr_loop_correct: |
1709 lemma pr_loop_correct: |
1714 assumes less: "y \<le> x" |
1710 assumes less: "y \<le> x" |
2229 |
2225 |
2230 lemma abc_list_crsp_elim: |
2226 lemma abc_list_crsp_elim: |
2231 "\<lbrakk>abc_list_crsp lma lmb; \<exists> n. lma = lmb @ 0\<up>n \<or> lmb = lma @ 0\<up>n \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P" |
2227 "\<lbrakk>abc_list_crsp lma lmb; \<exists> n. lma = lmb @ 0\<up>n \<or> lmb = lma @ 0\<up>n \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P" |
2232 by(auto simp: abc_list_crsp_def) |
2228 by(auto simp: abc_list_crsp_def) |
2233 |
2229 |
2234 lemma [simp]: |
2230 lemma abc_list_crsp_simp[simp]: |
2235 "\<lbrakk>abc_list_crsp lma lmb; m < length lma; m < length lmb\<rbrakk> \<Longrightarrow> |
2231 "\<lbrakk>abc_list_crsp lma lmb; m < length lma; m < length lmb\<rbrakk> \<Longrightarrow> |
2236 abc_list_crsp (lma[m := n]) (lmb[m := n])" |
2232 abc_list_crsp (lma[m := n]) (lmb[m := n])" |
2237 by(auto simp: abc_list_crsp_def list_update_append) |
2233 by(auto simp: abc_list_crsp_def list_update_append) |
2238 |
2234 |
2239 lemma [simp]: |
2235 lemma abc_list_crsp_simp2[simp]: |
2240 "\<lbrakk>abc_list_crsp lma lmb; m < length lma; \<not> m < length lmb\<rbrakk> \<Longrightarrow> |
2236 "\<lbrakk>abc_list_crsp lma lmb; m < length lma; \<not> m < length lmb\<rbrakk> \<Longrightarrow> |
2241 abc_list_crsp (lma[m := n]) (lmb @ 0 \<up> (m - length lmb) @ [n])" |
2237 abc_list_crsp (lma[m := n]) (lmb @ 0 \<up> (m - length lmb) @ [n])" |
2242 apply(auto simp: abc_list_crsp_def list_update_append) |
2238 apply(auto simp: abc_list_crsp_def list_update_append) |
2243 apply(rule_tac x = "na + length lmb - Suc m" in exI) |
2239 apply(rule_tac x = "na + length lmb - Suc m" in exI) |
2244 apply(rule_tac disjI1) |
2240 apply(rule_tac disjI1) |
2245 apply(simp add: upd_conv_take_nth_drop min_absorb1) |
2241 apply(simp add: upd_conv_take_nth_drop min_absorb1) |
2246 done |
2242 done |
2247 |
2243 |
2248 lemma [simp]: |
2244 lemma abc_list_crsp_simp3[simp]: |
2249 "\<lbrakk>abc_list_crsp lma lmb; \<not> m < length lma; m < length lmb\<rbrakk> \<Longrightarrow> |
2245 "\<lbrakk>abc_list_crsp lma lmb; \<not> m < length lma; m < length lmb\<rbrakk> \<Longrightarrow> |
2250 abc_list_crsp (lma @ 0 \<up> (m - length lma) @ [n]) (lmb[m := n])" |
2246 abc_list_crsp (lma @ 0 \<up> (m - length lma) @ [n]) (lmb[m := n])" |
2251 apply(auto simp: abc_list_crsp_def list_update_append) |
2247 apply(auto simp: abc_list_crsp_def list_update_append) |
2252 apply(rule_tac x = "na + length lma - Suc m" in exI) |
2248 apply(rule_tac x = "na + length lma - Suc m" in exI) |
2253 apply(rule_tac disjI2) |
2249 apply(rule_tac disjI2) |
2254 apply(simp add: upd_conv_take_nth_drop min_absorb1) |
2250 apply(simp add: upd_conv_take_nth_drop min_absorb1) |
2255 done |
2251 done |
2256 |
2252 |
2257 lemma [simp]: "\<lbrakk>abc_list_crsp lma lmb; \<not> m < length lma; \<not> m < length lmb\<rbrakk> \<Longrightarrow> |
2253 lemma abc_list_crsp_simp4[simp]: "\<lbrakk>abc_list_crsp lma lmb; \<not> m < length lma; \<not> m < length lmb\<rbrakk> \<Longrightarrow> |
2258 abc_list_crsp (lma @ 0 \<up> (m - length lma) @ [n]) (lmb @ 0 \<up> (m - length lmb) @ [n])" |
2254 abc_list_crsp (lma @ 0 \<up> (m - length lma) @ [n]) (lmb @ 0 \<up> (m - length lmb) @ [n])" |
2259 by(auto simp: abc_list_crsp_def list_update_append replicate_merge_anywhere) |
2255 by(auto simp: abc_list_crsp_def list_update_append replicate_merge_anywhere) |
2260 |
2256 |
2261 lemma abc_list_crsp_lm_s: |
2257 lemma abc_list_crsp_lm_s: |
2262 "abc_list_crsp lma lmb \<Longrightarrow> |
2258 "abc_list_crsp lma lmb \<Longrightarrow> |
2341 apply(case_tac "abc_steps_l (0, args @ 0 \<up> (ft - arity)) ap n", auto) |
2333 apply(case_tac "abc_steps_l (0, args @ 0 \<up> (ft - arity)) ap n", auto) |
2342 apply(drule_tac abc_list_crsp_steps, auto) |
2334 apply(drule_tac abc_list_crsp_steps, auto) |
2343 apply(rule_tac list_crsp_simp2, auto) |
2335 apply(rule_tac list_crsp_simp2, auto) |
2344 done |
2336 done |
2345 |
2337 |
2346 lemma [simp]: |
2338 lemma find_exponent_rec_exec[simp]: |
2347 assumes a: "args @ [rec_exec f args] = lm @ 0 \<up> n" |
2339 assumes a: "args @ [rec_exec f args] = lm @ 0 \<up> n" |
2348 and b: "length args < length lm" |
2340 and b: "length args < length lm" |
2349 shows "\<exists>m. lm = args @ rec_exec f args # 0 \<up> m" |
2341 shows "\<exists>m. lm = args @ rec_exec f args # 0 \<up> m" |
2350 using assms |
2342 using assms |
2351 apply(case_tac n, simp) |
2343 apply(case_tac n, simp) |
2352 apply(rule_tac x = 0 in exI, simp) |
2344 apply(rule_tac x = 0 in exI, simp) |
2353 apply(drule_tac length_equal, simp) |
2345 apply(drule_tac length_equal, simp) |
2354 done |
2346 done |
2355 |
2347 |
2356 lemma [simp]: |
2348 lemma find_exponent_complex[simp]: |
2357 "\<lbrakk>args @ [rec_exec f args] = lm @ 0 \<up> n; \<not> length args < length lm\<rbrakk> |
2349 "\<lbrakk>args @ [rec_exec f args] = lm @ 0 \<up> n; \<not> length args < length lm\<rbrakk> |
2358 \<Longrightarrow> \<exists>m. (lm @ 0 \<up> (length args - length lm) @ [Suc 0])[length args := 0] = |
2350 \<Longrightarrow> \<exists>m. (lm @ 0 \<up> (length args - length lm) @ [Suc 0])[length args := 0] = |
2359 args @ rec_exec f args # 0 \<up> m" |
2351 args @ rec_exec f args # 0 \<up> m" |
2360 apply(case_tac n, simp_all add: exp_suc list_update_append list_update.simps del: replicate_Suc) |
2352 apply(case_tac n, simp_all add: exp_suc list_update_append list_update.simps del: replicate_Suc) |
2361 apply(subgoal_tac "length args = Suc (length lm)", simp) |
2353 apply(subgoal_tac "length args = Suc (length lm)", simp) |
2524 (0, Bk\<up>Suc (Suc m), Oc\<up>Suc (rec_exec recf args) @ Bk\<up>l)" |
2516 (0, Bk\<up>Suc (Suc m), Oc\<up>Suc (rec_exec recf args) @ Bk\<up>l)" |
2525 proof(case_tac "rec_ci recf", simp add: tm_of_rec.simps) |
2517 proof(case_tac "rec_ci recf", simp add: tm_of_rec.simps) |
2526 fix ap ar fp |
2518 fix ap ar fp |
2527 assume "rec_ci recf = (ap, ar, fp)" |
2519 assume "rec_ci recf = (ap, ar, fp)" |
2528 thus "\<exists>stp m l. steps0 (Suc 0, [Bk, Bk], <args>) |
2520 thus "\<exists>stp m l. steps0 (Suc 0, [Bk, Bk], <args>) |
2529 (tm_of (ap [+] dummy_abc ar) @ shift (mopup ar) (listsum (layout_of (ap [+] dummy_abc ar)))) stp = |
2521 (tm_of (ap [+] dummy_abc ar) @ shift (mopup ar) (sum_list (layout_of (ap [+] dummy_abc ar)))) stp = |
2530 (0, Bk # Bk # Bk \<up> m, Oc # Oc \<up> rec_exec recf args @ Bk \<up> l)" |
2522 (0, Bk # Bk # Bk \<up> m, Oc # Oc \<up> rec_exec recf args @ Bk \<up> l)" |
2531 using recursive_compile_to_tm_correct1[of recf ap ar fp args "tm_of (ap [+] dummy_abc (length args))" "[]" 0] |
2523 using recursive_compile_to_tm_correct1[of recf ap ar fp args "tm_of (ap [+] dummy_abc (length args))" "[]" 0] |
2532 assms param_pattern[of recf args ap ar fp] |
2524 assms param_pattern[of recf args ap ar fp] |
2533 by(simp add: replicate_Suc[THEN sym] replicate_Suc_iff_anywhere del: replicate_Suc tm_of_rec_def, |
2525 by(simp add: replicate_Suc[THEN sym] replicate_Suc_iff_anywhere del: replicate_Suc, |
2534 simp add: exp_suc del: replicate_Suc) |
2526 simp add: exp_suc del: replicate_Suc) |
2535 qed |
2527 qed |
2536 |
2528 |
2537 lemma recursive_compile_to_tm_correct3: |
2529 lemma recursive_compile_to_tm_correct3: |
2538 assumes termi: "terminate recf args" |
2530 assumes termi: "terminate recf args" |
2539 shows "{\<lambda> tp. tp =([Bk, Bk], <args>)} (tm_of_rec recf) |
2531 shows "{\<lambda> tp. tp =([Bk, Bk], <args>)} (tm_of_rec recf) |
2540 {\<lambda> tp. \<exists> k l. tp = (Bk\<up> k, <rec_exec recf args> @ Bk \<up> l)}" |
2532 {\<lambda> tp. \<exists> k l. tp = (Bk\<up> k, <rec_exec recf args> @ Bk \<up> l)}" |
2541 using recursive_compile_to_tm_correct2[OF assms] |
2533 using recursive_compile_to_tm_correct2[OF assms] |
2542 apply(auto simp add: Hoare_halt_def) |
2534 apply(auto simp add: Hoare_halt_def) |
2543 apply(rule_tac x = stp in exI) |
2535 apply(rule_tac x = stp in exI) |
2544 apply(auto simp add: tape_of_nat_abv) |
2536 apply(auto simp add: tape_of_nat_def) |
2545 apply(rule_tac x = "Suc (Suc m)" in exI) |
2537 apply(rule_tac x = "Suc (Suc m)" in exI) |
2546 apply(simp) |
2538 apply(simp) |
2547 done |
2539 done |
2548 |
2540 |
2549 lemma [simp]: |
2541 lemma list_all_suc_many[simp]: |
2550 "list_all (\<lambda>(acn, s). s \<le> Suc (Suc (Suc (Suc (Suc (Suc (2 * n))))))) xs \<Longrightarrow> |
2542 "list_all (\<lambda>(acn, s). s \<le> Suc (Suc (Suc (Suc (Suc (Suc (2 * n))))))) xs \<Longrightarrow> |
2551 list_all (\<lambda>(acn, s). s \<le> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (2 * n))))))))) xs" |
2543 list_all (\<lambda>(acn, s). s \<le> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (2 * n))))))))) xs" |
2552 apply(induct xs, simp, simp) |
2544 apply(induct xs, simp, simp) |
2553 apply(case_tac a, simp) |
2545 apply(case_tac a, simp) |
2554 done |
2546 done |
2555 |
2547 |
2556 lemma shift_append: "shift (xs @ ys) n = shift xs n @ shift ys n" |
2548 lemma shift_append: "shift (xs @ ys) n = shift xs n @ shift ys n" |
2557 apply(simp add: shift.simps) |
2549 apply(simp add: shift.simps) |
2558 done |
2550 done |
2559 |
2551 |
2560 lemma [simp]: "length (shift (mopup n) ss) = 4 * n + 12" |
2552 lemma length_shift_mopup[simp]: "length (shift (mopup n) ss) = 4 * n + 12" |
2561 apply(auto simp: mopup.simps shift_append mopup_b_def) |
2553 apply(auto simp: mopup.simps shift_append mopup_b_def) |
2562 done |
2554 done |
2563 |
2555 |
2564 lemma length_tm_even[intro]: "length (tm_of ap) mod 2 = 0" |
2556 lemma length_tm_even[intro]: "length (tm_of ap) mod 2 = 0" |
2565 apply(simp add: tm_of.simps) |
2557 apply(simp add: tm_of.simps) |
2566 done |
2558 done |
2567 |
2559 |
2568 lemma [simp]: "k < length ap \<Longrightarrow> tms_of ap ! k = |
2560 lemma tms_of_at_index[simp]: "k < length ap \<Longrightarrow> tms_of ap ! k = |
2569 ci (layout_of ap) (start_of (layout_of ap) k) (ap ! k)" |
2561 ci (layout_of ap) (start_of (layout_of ap) k) (ap ! k)" |
2570 apply(simp add: tms_of.simps tpairs_of.simps) |
2562 apply(simp add: tms_of.simps tpairs_of.simps) |
2571 done |
2563 done |
2572 |
2564 |
2573 lemma start_of_suc_inc: |
2565 lemma start_of_suc_inc: |
2738 lemma length_start_of_tm: "start_of (layout_of ap) (length ap) = Suc (length (tm_of ap) div 2)" |
2729 lemma length_start_of_tm: "start_of (layout_of ap) (length ap) = Suc (length (tm_of ap) div 2)" |
2739 using tpa_states[of "tm_of ap" "length ap" ap] |
2730 using tpa_states[of "tm_of ap" "length ap" ap] |
2740 apply(simp add: tm_of.simps) |
2731 apply(simp add: tm_of.simps) |
2741 done |
2732 done |
2742 |
2733 |
2743 lemma [elim]: "list_all (\<lambda>(acn, s). s \<le> Suc q) xs |
2734 lemma list_all_add_6E[elim]: "list_all (\<lambda>(acn, s). s \<le> Suc q) xs |
2744 \<Longrightarrow> list_all (\<lambda>(acn, s). s \<le> q + (2 * n + 6)) xs" |
2735 \<Longrightarrow> list_all (\<lambda>(acn, s). s \<le> q + (2 * n + 6)) xs" |
2745 apply(simp add: list_all_length) |
2736 by(auto simp: list_all_length) |
2746 apply(auto) |
2737 |
2747 done |
2738 lemma mopup_b_12[simp]: "length mopup_b = 12" |
2748 |
|
2749 lemma [simp]: "length mopup_b = 12" |
|
2750 apply(simp add: mopup_b_def) |
2739 apply(simp add: mopup_b_def) |
2751 done |
2740 done |
2752 |
2741 |
2753 lemma mp_up_all_le: "list_all (\<lambda>(acn, s). s \<le> q + (2 * n + 6)) |
2742 lemma mp_up_all_le: "list_all (\<lambda>(acn, s). s \<le> q + (2 * n + 6)) |
2754 [(R, Suc (Suc (2 * n + q))), (R, Suc (2 * n + q)), |
2743 [(R, Suc (Suc (2 * n + q))), (R, Suc (2 * n + q)), |
2755 (L, 5 + 2 * n + q), (W0, Suc (Suc (Suc (2 * n + q)))), (R, 4 + 2 * n + q), |
2744 (L, 5 + 2 * n + q), (W0, Suc (Suc (Suc (2 * n + q)))), (R, 4 + 2 * n + q), |
2756 (W0, Suc (Suc (Suc (2 * n + q)))), (R, Suc (Suc (2 * n + q))), |
2745 (W0, Suc (Suc (Suc (2 * n + q)))), (R, Suc (Suc (2 * n + q))), |
2757 (W0, Suc (Suc (Suc (2 * n + q)))), (L, 5 + 2 * n + q), |
2746 (W0, Suc (Suc (Suc (2 * n + q)))), (L, 5 + 2 * n + q), |
2758 (L, 6 + 2 * n + q), (R, 0), (L, 6 + 2 * n + q)]" |
2747 (L, 6 + 2 * n + q), (R, 0), (L, 6 + 2 * n + q)]" |
2759 apply(auto) |
2748 by(auto) |
2760 done |
2749 |
2761 |
2750 lemma mopup_le6[simp]: "(a, b) \<in> set (mopup_a n) \<Longrightarrow> b \<le> 2 * n + 6" |
2762 lemma [simp]: "(a, b) \<in> set (mopup_a n) \<Longrightarrow> b \<le> 2 * n + 6" |
|
2763 apply(induct n, auto simp: mopup_a.simps) |
2751 apply(induct n, auto simp: mopup_a.simps) |
2764 done |
2752 done |
2765 |
2753 |
2766 lemma [simp]: "(a, b) \<in> set (shift (mopup n) (listsum (layout_of ap))) |
2754 lemma shift_le2[simp]: "(a, b) \<in> set (shift (mopup n) x) |
2767 \<Longrightarrow> b \<le> (2 * listsum (layout_of ap) + length (mopup n)) div 2" |
2755 \<Longrightarrow> b \<le> (2 * x + length (mopup n)) div 2" |
2768 apply(auto simp: mopup.simps shift_append shift.simps) |
2756 apply(auto simp: mopup.simps shift_append shift.simps) |
2769 apply(auto simp: mopup_a.simps mopup_b_def) |
2757 apply(auto simp: mopup_b_def) |
2770 done |
2758 done |
2771 |
2759 |
2772 lemma [intro]: " 2 \<le> 2 * listsum (layout_of ap) + length (mopup n)" |
2760 lemma mopup_ge2[intro]: " 2 \<le> x + length (mopup n)" |
2773 apply(simp add: mopup.simps) |
2761 apply(simp add: mopup.simps) |
2774 done |
2762 done |
2775 |
2763 |
2776 lemma [intro]: " (2 * listsum (layout_of ap) + length (mopup n)) mod 2 = 0" |
2764 lemma mopup_even[intro]: " (2 * x + length (mopup n)) mod 2 = 0" |
2777 apply(auto simp: mopup.simps) |
2765 by(auto simp: mopup.simps) |
2778 apply arith |
2766 |
2779 done |
2767 lemma mopup_div_2[simp]: "b \<le> Suc x |
2780 |
|
2781 lemma [simp]: "b \<le> Suc x |
|
2782 \<Longrightarrow> b \<le> (2 * x + length (mopup n)) div 2" |
2768 \<Longrightarrow> b \<le> (2 * x + length (mopup n)) div 2" |
2783 apply(auto simp: mopup.simps) |
2769 by(auto simp: mopup.simps) |
2784 done |
2770 |
2785 |
2771 lemma wf_tm_from_abacus: assumes "tp = tm_of ap" |
2786 lemma wf_tm_from_abacus: |
2772 shows "tm_wf0 (tp @ shift (mopup n) (length tp div 2))" |
2787 "tp = tm_of ap \<Longrightarrow> |
2773 proof - |
2788 tm_wf (tp @ shift( mopup n) (length tp div 2), 0)" |
2774 have "is_even (length (mopup n))" for n using tm_wf.simps by blast |
2789 using length_start_of_tm[of ap] all_le_start_of[of ap] |
2775 moreover have "(aa, ba) \<in> set (mopup n) \<Longrightarrow> ba \<le> length (mopup n) div 2" for aa ba |
2790 apply(auto simp: tm_wf.simps List.list_all_iff) |
2776 by (metis (no_types, lifting) add_cancel_left_right case_prodD tm_wf.simps wf_mopup) |
2791 apply(case_tac n) |
2777 moreover have "(\<forall>x\<in>set (tm_of ap). case x of (acn, s) \<Rightarrow> s \<le> Suc (sum_list (layout_of ap))) \<Longrightarrow> |
2792 apply(simp add: mopup.simps) |
2778 (a, b) \<in> set (tm_of ap) \<Longrightarrow> b \<le> sum_list (layout_of ap) + length (mopup n) div 2" |
2793 apply(simp add: mopup.simps) |
2779 for a b s |
2794 apply (metis mod_mult_right_eq mod_mult_self2 mod_mult_self2_is_0 mult_2_right nat_mult_commute numeral_Bit0) |
2780 by (metis (no_types, lifting) add_Suc add_cancel_left_right case_prodD div_mult_mod_eq le_SucE mult_2_right not_numeral_le_zero tm_wf.simps trans_le_add1 wf_mopup) |
2795 sorry |
2781 ultimately show ?thesis unfolding assms |
|
2782 using length_start_of_tm[of ap] all_le_start_of[of ap] tm_wf.simps |
|
2783 by(auto simp: List.list_all_iff shift.simps) |
|
2784 qed |
2796 |
2785 |
2797 lemma wf_tm_from_recf: |
2786 lemma wf_tm_from_recf: |
2798 assumes compile: "tp = tm_of_rec recf" |
2787 assumes compile: "tp = tm_of_rec recf" |
2799 shows "tm_wf0 tp" |
2788 shows "tm_wf0 tp" |
2800 proof - |
2789 proof - |