From 5f5d74726335a0b5b9b2ec905808e60c5d0e1032 Mon Sep 17 00:00:00 2001 From: Wilmer Ricciotti Date: Thu, 17 May 2012 14:18:36 +0000 Subject: [PATCH] Progress --- matita/matita/lib/turing/universal/copy.ma | 131 +++++++++++++++++---- 1 file changed, 106 insertions(+), 25 deletions(-) diff --git a/matita/matita/lib/turing/universal/copy.ma b/matita/matita/lib/turing/universal/copy.ma index 2978b5cc4..467055248 100644 --- a/matita/matita/lib/turing/universal/copy.ma +++ b/matita/matita/lib/turing/universal/copy.ma @@ -44,12 +44,11 @@ definition copy_step_subcase ≝ definition R_copy_step_subcase ≝ λalpha,c,RelseM,t1,t2. - ∀ls,x,rs.t1 = midtape (FinProd … alpha FinBool) ls 〈x,true〉 rs → - (x = c ∧ - ∀a,l1,x0,a0,l2,l3. (∀c.memb ? c l1 = true → is_marked ? c = false) → - ls = l1@〈a0,false〉::〈x0,true〉::l2 → - rs = 〈a,false〉::l3 → - t2 = midtape ? (〈x,false〉::l1@〈a0,true〉::〈x,false〉::l2) 〈a,true〉 l3) ∨ + ∀a,l1,x0,a0,l2,x,l3. + t1 = midtape (FinProd … alpha FinBool) (l1@〈a0,false〉::〈x0,true〉::l2) + 〈x,true〉 (〈a,false〉::l3) → + (∀c.memb ? c l1 = true → is_marked ? c = false) → + (x = c ∧ t2 = midtape ? (〈x,false〉::l1@〈a0,true〉::〈x,false〉::l2) 〈a,true〉 l3) ∨ (x ≠ c ∧ RelseM t1 t2). axiom sem_copy_step_subcase : @@ -75,41 +74,123 @@ else if current = 1,tt mark; move_r; advance_to_mark_r; -else nop +else if current = null + then advance_mark_r; + move_l; + advance_to_mark_l + adv_mark_r; + move_r; + advance_to_mark_r *) +definition nocopy_subcase ≝ + ifTM STape (test_char ? (λx:STape.x == 〈null,true〉)) + (seq ? (adv_mark_r …) + (seq ? (move_l …) + (seq ? (adv_to_mark_l … (is_marked ?)) + (seq ? (adv_mark_r …) + (seq ? (move_r …) (adv_to_mark_r … (is_marked ?))))))) + (nop ?) tc_true. + +definition R_nocopy_subcase ≝ + λt1,t2. + ∀a,l1,x0,a0,l2,x,l3. + t1 = midtape STape (l1@〈a0,false〉::〈x0,true〉::l2) + 〈x,true〉 (〈a,false〉::l3) → + (∀c.memb ? c l1 = true → is_marked ? c = false) → + (x = null ∧ + t2 = midtape ? (〈x,false〉::l1@〈a0,true〉::〈x0,false〉::l2) 〈a,true〉 l3) ∨ + (x ≠ null ∧ t2 = t1). + +axiom sem_nocopy_subcase : Realize ? nocopy_subcase R_nocopy_subcase. +(* #intape +cases (sem_if ? (test_char ? (λx:STape.x == 〈null,true〉)) ?????? tc_true + (sem_test_char ? (λx:STape.x == 〈null,true〉)) + (sem_seq … (sem_adv_mark_r …) + (sem_seq … (sem_move_l …) + (sem_seq … (sem_adv_to_mark_l … (is_marked ?)) + (sem_seq … (sem_adv_mark_r …) + (sem_seq … (sem_move_r …) (sem_adv_to_mark_r … (is_marked ?)) + ))))) (sem_nop ?) intape) +#k * #outc * #Hloop #HR @(ex_intro ?? k) @(ex_intro ?? outc) % [@Hloop] -Hloop +cases HR -HR +[| * #ta * whd in ⊢ (%→%→?); #Hta #Houtc + #ls #x #rs #Hintape %2 >Hintape in Hta; #Hta cases (Hta ? (refl ??)) -Hta #Hx #Hta % + [ lapply (\Pf Hx) @not_to_not #Hx' >Hx' % + |