1264 |
1264 |
1265 declare adjust.simps[simp] |
1265 declare adjust.simps[simp] |
1266 |
1266 |
1267 lemma adjust_fetch0: |
1267 lemma adjust_fetch0: |
1268 "\<lbrakk>0 < a; a \<le> length ap div 2; fetch ap a b = (aa, 0)\<rbrakk> |
1268 "\<lbrakk>0 < a; a \<le> length ap div 2; fetch ap a b = (aa, 0)\<rbrakk> |
1269 \<Longrightarrow> fetch (adjust ap) a b = (aa, Suc (length ap div 2))" |
1269 \<Longrightarrow> fetch (adjust0 ap) a b = (aa, Suc (length ap div 2))" |
1270 apply(case_tac b, auto simp: fetch.simps nth_of.simps nth_map |
1270 apply(case_tac b, auto simp: fetch.simps nth_of.simps nth_map |
1271 split: if_splits) |
1271 split: if_splits) |
1272 apply(case_tac [!] a, auto simp: fetch.simps nth_of.simps) |
1272 apply(case_tac [!] a, auto simp: fetch.simps nth_of.simps) |
1273 done |
1273 done |
1274 |
1274 |
1275 lemma adjust_fetch_norm: |
1275 lemma adjust_fetch_norm: |
1276 "\<lbrakk>st > 0; st \<le> length tp div 2; fetch ap st b = (aa, ns); ns \<noteq> 0\<rbrakk> |
1276 "\<lbrakk>st > 0; st \<le> length tp div 2; fetch ap st b = (aa, ns); ns \<noteq> 0\<rbrakk> |
1277 \<Longrightarrow> fetch (Turing.adjust ap) st b = (aa, ns)" |
1277 \<Longrightarrow> fetch (adjust0 ap) st b = (aa, ns)" |
1278 apply(case_tac b, auto simp: fetch.simps nth_of.simps nth_map |
1278 apply(case_tac b, auto simp: fetch.simps nth_of.simps nth_map |
1279 split: if_splits) |
1279 split: if_splits) |
1280 apply(case_tac [!] st, auto simp: fetch.simps nth_of.simps) |
1280 apply(case_tac [!] st, auto simp: fetch.simps nth_of.simps) |
1281 done |
1281 done |
1282 |
1282 |
1315 |
1315 |
1316 lemma adjust_steps_eq: |
1316 lemma adjust_steps_eq: |
1317 assumes exec: "steps0 (st,l,r) ap stp = (st', l', r')" |
1317 assumes exec: "steps0 (st,l,r) ap stp = (st', l', r')" |
1318 and wf_tm: "tm_wf (ap, 0)" |
1318 and wf_tm: "tm_wf (ap, 0)" |
1319 and notfinal: "st' > 0" |
1319 and notfinal: "st' > 0" |
1320 shows "steps0 (st, l, r) (adjust ap) stp = (st', l', r')" |
1320 shows "steps0 (st, l, r) (adjust0 ap) stp = (st', l', r')" |
1321 using exec notfinal |
1321 using exec notfinal |
1322 proof(induct stp arbitrary: st' l' r') |
1322 proof(induct stp arbitrary: st' l' r') |
1323 case 0 |
1323 case 0 |
1324 thus "?case" |
1324 thus "?case" |
1325 by(simp add: steps.simps) |
1325 by(simp add: steps.simps) |
1326 next |
1326 next |
1327 case (Suc stp st' l' r') |
1327 case (Suc stp st' l' r') |
1328 have ind: "\<And>st' l' r'. \<lbrakk>steps0 (st, l, r) ap stp = (st', l', r'); 0 < st'\<rbrakk> |
1328 have ind: "\<And>st' l' r'. \<lbrakk>steps0 (st, l, r) ap stp = (st', l', r'); 0 < st'\<rbrakk> |
1329 \<Longrightarrow> steps0 (st, l, r) (Turing.adjust ap) stp = (st', l', r')" by fact |
1329 \<Longrightarrow> steps0 (st, l, r) (adjust0 ap) stp = (st', l', r')" by fact |
1330 have h: "steps0 (st, l, r) ap (Suc stp) = (st', l', r')" by fact |
1330 have h: "steps0 (st, l, r) ap (Suc stp) = (st', l', r')" by fact |
1331 have g: "0 < st'" by fact |
1331 have g: "0 < st'" by fact |
1332 obtain st'' l'' r'' where a: "steps0 (st, l, r) ap stp = (st'', l'', r'')" |
1332 obtain st'' l'' r'' where a: "steps0 (st, l, r) ap stp = (st'', l'', r'')" |
1333 by (metis prod_cases3) |
1333 by (metis prod_cases3) |
1334 hence c:"0 < st''" |
1334 hence c:"0 < st''" |
1335 using h g |
1335 using h g |
1336 apply(simp add: step_red) |
1336 apply(simp add: step_red) |
1337 apply(case_tac st'', auto) |
1337 apply(case_tac st'', auto) |
1338 done |
1338 done |
1339 hence b: "steps0 (st, l, r) (Turing.adjust ap) stp = (st'', l'', r'')" |
1339 hence b: "steps0 (st, l, r) (adjust0 ap) stp = (st'', l'', r'')" |
1340 using a |
1340 using a |
1341 by(rule_tac ind, simp_all) |
1341 by(rule_tac ind, simp_all) |
1342 thus "?case" |
1342 thus "?case" |
1343 using assms a b h g |
1343 using assms a b h g |
1344 apply(simp add: step_red) |
1344 apply(simp add: step_red) |
1347 qed |
1347 qed |
1348 |
1348 |
1349 lemma adjust_halt_eq: |
1349 lemma adjust_halt_eq: |
1350 assumes exec: "steps0 (1, l, r) ap stp = (0, l', r')" |
1350 assumes exec: "steps0 (1, l, r) ap stp = (0, l', r')" |
1351 and tm_wf: "tm_wf (ap, 0)" |
1351 and tm_wf: "tm_wf (ap, 0)" |
1352 shows "\<exists> stp. steps0 (Suc 0, l, r) (adjust ap) stp = |
1352 shows "\<exists> stp. steps0 (Suc 0, l, r) (adjust0 ap) stp = |
1353 (Suc (length ap div 2), l', r')" |
1353 (Suc (length ap div 2), l', r')" |
1354 proof - |
1354 proof - |
1355 have "\<exists> stp. \<not> is_final (steps0 (1, l, r) ap stp) \<and> (steps0 (1, l, r) ap (Suc stp) = (0, l', r'))" |
1355 have "\<exists> stp. \<not> is_final (steps0 (1, l, r) ap stp) \<and> (steps0 (1, l, r) ap (Suc stp) = (0, l', r'))" |
1356 using exec |
1356 using exec |
1357 by(erule_tac before_final) |
1357 by(erule_tac before_final) |
1358 then obtain stpa where a: |
1358 then obtain stpa where a: |
1359 "\<not> is_final (steps0 (1, l, r) ap stpa) \<and> (steps0 (1, l, r) ap (Suc stpa) = (0, l', r'))" .. |
1359 "\<not> is_final (steps0 (1, l, r) ap stpa) \<and> (steps0 (1, l, r) ap (Suc stpa) = (0, l', r'))" .. |
1360 obtain sa la ra where b:"steps0 (1, l, r) ap stpa = (sa, la, ra)" by (metis prod_cases3) |
1360 obtain sa la ra where b:"steps0 (1, l, r) ap stpa = (sa, la, ra)" by (metis prod_cases3) |
1361 hence c: "steps0 (Suc 0, l, r) (adjust ap) stpa = (sa, la, ra)" |
1361 hence c: "steps0 (Suc 0, l, r) (adjust0 ap) stpa = (sa, la, ra)" |
1362 using assms a |
1362 using assms a |
1363 apply(rule_tac adjust_steps_eq, simp_all) |
1363 apply(rule_tac adjust_steps_eq, simp_all) |
1364 done |
1364 done |
1365 have d: "sa \<le> length ap div 2" |
1365 have d: "sa \<le> length ap div 2" |
1366 using steps_in_range[of "(l, r)" ap stpa] a tm_wf b |
1366 using steps_in_range[of "(l, r)" ap stpa] a tm_wf b |
1400 by(rule_tac t_twice_correct) |
1400 by(rule_tac t_twice_correct) |
1401 then obtain stp ln rn where " steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1401 then obtain stp ln rn where " steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1402 (tm_of abc_twice @ shift (mopup (Suc 0)) ((length (tm_of abc_twice) div 2))) stp = |
1402 (tm_of abc_twice @ shift (mopup (Suc 0)) ((length (tm_of abc_twice) div 2))) stp = |
1403 (0, Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" by blast |
1403 (0, Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" by blast |
1404 hence "\<exists> stp. steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1404 hence "\<exists> stp. steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1405 (adjust t_twice_compile) stp |
1405 (adjust0 t_twice_compile) stp |
1406 = (Suc (length t_twice_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" |
1406 = (Suc (length t_twice_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" |
1407 apply(rule_tac stp = stp in adjust_halt_eq) |
1407 apply(rule_tac stp = stp in adjust_halt_eq) |
1408 apply(simp add: t_twice_compile_def, auto) |
1408 apply(simp add: t_twice_compile_def, auto) |
1409 done |
1409 done |
1410 then obtain stpb where |
1410 then obtain stpb where |
1411 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1411 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
1412 (adjust t_twice_compile) stpb |
1412 (adjust0 t_twice_compile) stpb |
1413 = (Suc (length t_twice_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" .. |
1413 = (Suc (length t_twice_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (2 * rs)) @ Bk\<up>(rn))" .. |
1414 thus "?thesis" |
1414 thus "?thesis" |
1415 apply(simp add: t_twice_def t_twice_len_def) |
1415 apply(simp add: t_twice_def t_twice_len_def) |
1416 by metis |
1416 by metis |
1417 qed |
1417 qed |
2077 then obtain stp ln rn where |
2077 then obtain stp ln rn where |
2078 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2078 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2079 (tm_of abc_fourtimes @ shift (mopup 1) ((length (tm_of abc_fourtimes) div 2))) stp = |
2079 (tm_of abc_fourtimes @ shift (mopup 1) ((length (tm_of abc_fourtimes) div 2))) stp = |
2080 (0, Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" by blast |
2080 (0, Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" by blast |
2081 hence "\<exists> stp. steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2081 hence "\<exists> stp. steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2082 (adjust t_fourtimes_compile) stp |
2082 (adjust0 t_fourtimes_compile) stp |
2083 = (Suc (length t_fourtimes_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" |
2083 = (Suc (length t_fourtimes_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" |
2084 apply(rule_tac stp = stp in adjust_halt_eq) |
2084 apply(rule_tac stp = stp in adjust_halt_eq) |
2085 apply(simp add: t_fourtimes_compile_def, auto) |
2085 apply(simp add: t_fourtimes_compile_def, auto) |
2086 done |
2086 done |
2087 then obtain stpb where |
2087 then obtain stpb where |
2088 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2088 "steps0 (Suc 0, Bk # Bk # ires, Oc\<up>(Suc rs) @ Bk\<up>(n)) |
2089 (adjust t_fourtimes_compile) stpb |
2089 (adjust0 t_fourtimes_compile) stpb |
2090 = (Suc (length t_fourtimes_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" .. |
2090 = (Suc (length t_fourtimes_compile div 2), Bk\<up>(ln) @ Bk # Bk # ires, Oc\<up>(Suc (4 * rs)) @ Bk\<up>(rn))" .. |
2091 thus "?thesis" |
2091 thus "?thesis" |
2092 apply(simp add: t_fourtimes_def t_fourtimes_len_def) |
2092 apply(simp add: t_fourtimes_def t_fourtimes_len_def) |
2093 by metis |
2093 by metis |
2094 qed |
2094 qed |
3374 |
3374 |
3375 lemma [simp]: "length (mopup (Suc 0)) = 16" |
3375 lemma [simp]: "length (mopup (Suc 0)) = 16" |
3376 apply(auto simp: mopup.simps) |
3376 apply(auto simp: mopup.simps) |
3377 done |
3377 done |
3378 |
3378 |
3379 lemma [elim]: "(a, b) \<in> set (shift (Turing.adjust t_twice_compile) 12) \<Longrightarrow> |
3379 lemma [elim]: "(a, b) \<in> set (shift (adjust0 t_twice_compile) 12) \<Longrightarrow> |
3380 b \<le> (28 + (length t_twice_compile + length t_fourtimes_compile)) div 2" |
3380 b \<le> (28 + (length t_twice_compile + length t_fourtimes_compile)) div 2" |
3381 apply(simp add: t_twice_compile_def t_fourtimes_compile_def) |
3381 apply(simp add: t_twice_compile_def t_fourtimes_compile_def) |
3382 proof - |
3382 proof - |
3383 assume g: "(a, b) \<in> set (shift (Turing.adjust (tm_of abc_twice @ shift (mopup (Suc 0)) (length (tm_of abc_twice) div 2))) 12)" |
3383 assume g: "(a, b) |
|
3384 \<in> set (shift |
|
3385 (adjust |
|
3386 (tm_of abc_twice @ |
|
3387 shift (mopup (Suc 0)) (length (tm_of abc_twice) div 2)) |
|
3388 (Suc ((length (tm_of abc_twice) + 16) div 2))) |
|
3389 12)" |
3384 moreover have "length (tm_of abc_twice) mod 2 = 0" by auto |
3390 moreover have "length (tm_of abc_twice) mod 2 = 0" by auto |
3385 moreover have "length (tm_of abc_fourtimes) mod 2 = 0" by auto |
3391 moreover have "length (tm_of abc_fourtimes) mod 2 = 0" by auto |
3386 ultimately have "list_all (\<lambda>(acn, st). (st \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2)) |
3392 ultimately have "list_all (\<lambda>(acn, st). (st \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2)) |
3387 (shift (Turing.adjust t_twice_compile) 12)" |
3393 (shift (adjust0 t_twice_compile) 12)" |
3388 proof(auto simp: mod_ex1) |
3394 proof(auto simp add: mod_ex1 del: adjust.simps) |
3389 fix q qa |
3395 fix q qa |
3390 assume h: "length (tm_of abc_twice) = 2 * q" "length (tm_of abc_fourtimes) = 2 * qa" |
3396 assume h: "length (tm_of abc_twice) = 2 * q" "length (tm_of abc_fourtimes) = 2 * qa" |
3391 hence "list_all (\<lambda>(acn, st). st \<le> (18 + (q + qa)) + 12) (shift (Turing.adjust t_twice_compile) 12)" |
3397 hence "list_all (\<lambda>(acn, st). st \<le> (18 + (q + qa)) + 12) (shift (adjust0 t_twice_compile) 12)" |
3392 proof(rule_tac tm_wf_shift t_twice_compile_def) |
3398 proof(rule_tac tm_wf_shift t_twice_compile_def) |
3393 have "list_all (\<lambda>(acn, st). st \<le> Suc (length t_twice_compile div 2)) (adjust t_twice_compile)" |
3399 have "list_all (\<lambda>(acn, st). st \<le> Suc (length t_twice_compile div 2)) (adjust0 t_twice_compile)" |
3394 by(rule_tac tm_wf_change_termi, auto) |
3400 by(rule_tac tm_wf_change_termi, auto) |
3395 thus "list_all (\<lambda>(acn, st). st \<le> 18 + (q + qa)) (Turing.adjust t_twice_compile)" |
3401 thus "list_all (\<lambda>(acn, st). st \<le> 18 + (q + qa)) (adjust0 t_twice_compile)" |
3396 using h |
3402 using h |
3397 apply(simp add: t_twice_compile_def, auto simp: List.list_all_length) |
3403 apply(simp add: t_twice_compile_def, auto simp: List.list_all_length) |
3398 done |
3404 done |
3399 qed |
3405 qed |
3400 thus "list_all (\<lambda>(acn, st). st \<le> 30 + (q + qa)) (shift (Turing.adjust t_twice_compile) 12)" |
3406 thus "list_all (\<lambda>(acn, st). st \<le> 30 + (q + qa)) |
|
3407 (shift |
|
3408 (adjust t_twice_compile (Suc (length t_twice_compile div 2))) 12)" |
3401 by simp |
3409 by simp |
3402 qed |
3410 qed |
3403 thus "b \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2" |
3411 thus "b \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2" |
3404 using g |
3412 using g |
3405 apply(auto simp:t_twice_compile_def) |
3413 apply(auto simp:t_twice_compile_def) |
3406 apply(simp add: Ball_set[THEN sym]) |
3414 apply(simp add: Ball_set[THEN sym]) |
3407 apply(erule_tac x = "(a, b)" in ballE, simp, simp) |
3415 apply(erule_tac x = "(a, b)" in ballE, simp, simp) |
3408 done |
3416 done |
3409 qed |
3417 qed |
3410 |
3418 |
3411 lemma [elim]: "(a, b) \<in> set (shift (Turing.adjust t_fourtimes_compile) (t_twice_len + 13)) |
3419 lemma [elim]: "(a, b) \<in> set (shift (adjust0 t_fourtimes_compile) (t_twice_len + 13)) |
3412 \<Longrightarrow> b \<le> (28 + (length t_twice_compile + length t_fourtimes_compile)) div 2" |
3420 \<Longrightarrow> b \<le> (28 + (length t_twice_compile + length t_fourtimes_compile)) div 2" |
3413 apply(simp add: t_twice_compile_def t_fourtimes_compile_def t_twice_len_def) |
3421 apply(simp add: t_twice_compile_def t_fourtimes_compile_def t_twice_len_def) |
3414 proof - |
3422 proof - |
3415 assume g: "(a, b) \<in> set (shift (Turing.adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) |
3423 assume g: "(a, b) |
3416 (length (tm_of abc_fourtimes) div 2))) (length t_twice div 2 + 13))" |
3424 \<in> set (shift |
|
3425 (adjust |
|
3426 (tm_of abc_fourtimes @ |
|
3427 shift (mopup (Suc 0)) (length (tm_of abc_fourtimes) div 2)) |
|
3428 (Suc ((length (tm_of abc_fourtimes) + 16) div 2))) |
|
3429 (length t_twice div 2 + 13))" |
3417 moreover have "length (tm_of abc_twice) mod 2 = 0" by auto |
3430 moreover have "length (tm_of abc_twice) mod 2 = 0" by auto |
3418 moreover have "length (tm_of abc_fourtimes) mod 2 = 0" by auto |
3431 moreover have "length (tm_of abc_fourtimes) mod 2 = 0" by auto |
3419 ultimately have "list_all (\<lambda>(acn, st). (st \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2)) |
3432 ultimately have "list_all (\<lambda>(acn, st). (st \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2)) |
3420 (shift (Turing.adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) |
3433 (shift (adjust0 (tm_of abc_fourtimes @ shift (mopup (Suc 0)) |
3421 (length (tm_of abc_fourtimes) div 2))) (length t_twice div 2 + 13))" |
3434 (length (tm_of abc_fourtimes) div 2))) (length t_twice div 2 + 13))" |
3422 proof(auto simp: mod_ex1 t_twice_def t_twice_compile_def) |
3435 proof(auto simp: mod_ex1 t_twice_def t_twice_compile_def) |
3423 fix q qa |
3436 fix q qa |
3424 assume h: "length (tm_of abc_twice) = 2 * q" "length (tm_of abc_fourtimes) = 2 * qa" |
3437 assume h: "length (tm_of abc_twice) = 2 * q" "length (tm_of abc_fourtimes) = 2 * qa" |
3425 hence "list_all (\<lambda>(acn, st). st \<le> (9 + qa + (21 + q))) |
3438 hence "list_all (\<lambda>(acn, st). st \<le> (9 + qa + (21 + q))) |
3426 (shift (Turing.adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa)) (21 + q))" |
3439 (shift (adjust0 (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa)) (21 + q))" |
3427 proof(rule_tac tm_wf_shift t_twice_compile_def) |
3440 proof(rule_tac tm_wf_shift t_twice_compile_def) |
3428 have "list_all (\<lambda>(acn, st). st \<le> Suc (length (tm_of abc_fourtimes @ shift |
3441 have "list_all (\<lambda>(acn, st). st \<le> Suc (length (tm_of abc_fourtimes @ shift |
3429 (mopup (Suc 0)) qa) div 2)) (adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa))" |
3442 (mopup (Suc 0)) qa) div 2)) (adjust0 (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa))" |
3430 apply(rule_tac tm_wf_change_termi) |
3443 apply(rule_tac tm_wf_change_termi) |
3431 using wf_fourtimes h |
3444 using wf_fourtimes h |
3432 apply(simp add: t_fourtimes_compile_def) |
3445 apply(simp add: t_fourtimes_compile_def) |
3433 done |
3446 done |
3434 thus "list_all (\<lambda>(acn, st). st \<le> 9 + qa) ((Turing.adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa)))" |
3447 thus "list_all (\<lambda>(acn, st). st \<le> 9 + qa) |
|
3448 (adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa) |
|
3449 (Suc (length (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa) div |
|
3450 2)))" |
3435 using h |
3451 using h |
3436 apply(simp) |
3452 apply(simp) |
3437 done |
3453 done |
3438 qed |
3454 qed |
3439 thus "list_all (\<lambda>(acn, st). st \<le> 30 + (q + qa)) (shift (Turing.adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa)) (21 + q))" |
3455 thus "list_all (\<lambda>(acn, st). st \<le> 30 + (q + qa)) |
|
3456 (shift |
|
3457 (adjust (tm_of abc_fourtimes @ shift (mopup (Suc 0)) qa) |
|
3458 (9 + qa)) |
|
3459 (21 + q))" |
3440 apply(subgoal_tac "qa + q = q + qa") |
3460 apply(subgoal_tac "qa + q = q + qa") |
3441 apply(simp, simp) |
3461 apply(simp add: h) |
|
3462 apply(simp) |
3442 done |
3463 done |
3443 qed |
3464 qed |
3444 thus "b \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2" |
3465 thus "b \<le> (60 + (length (tm_of abc_twice) + length (tm_of abc_fourtimes))) div 2" |
3445 using g |
3466 using g |
3446 apply(simp add: Ball_set[THEN sym]) |
3467 apply(simp add: Ball_set[THEN sym]) |