cases (current ? (nth i ? int (niltape ?))) in ⊢ (???%→?);
[ #Hcuri %{2} %
[| % [ %
- [ whd in ⊢ (??%?); >comp_q0_q2_null /2/ % <Hcuri in ⊢ (???%);
- @sym_eq @nth_vec_map
+ [ whd in ⊢ (??%?); >comp_q0_q2_null /2/
| normalize in ⊢ (%→?); #H destruct (H) ]
| #_ % // % %2 // ] ]
| #a #Ha lapply (refl ? (current ? (nth j ? int (niltape ?))))
cases (current ? (nth j ? int (niltape ?))) in ⊢ (???%→?);
[ #Hcurj %{2} %
[| % [ %
- [ whd in ⊢ (??%?); >comp_q0_q2_null /2/ %2 <Hcurj in ⊢ (???%);
- @sym_eq @nth_vec_map
+ [ whd in ⊢ (??%?); >comp_q0_q2_null /2/ %2
| normalize in ⊢ (%→?); #H destruct (H) ]
| #_ % // >Ha >Hcurj % % % #H destruct (H) ] ]
| #b #Hb %{2} cases (true_or_false (a == b)) #Hab
[ %
[| % [ %
[whd in ⊢ (??%?); >(comp_q0_q1 … a Hneq Hi Hj) //
- [>(\P Hab) <Hb @sym_eq @nth_vec_map
- |<Ha @sym_eq @nth_vec_map ]
+ >(\P Hab) <Hb @sym_eq @nth_vec_map
| #_ whd >(\P Hab) %{b} % // % // <(\P Hab) // ]
| * #H @False_ind @H %
] ]
lemma sem_compare : ∀i,j,sig,n.
i ≠ j → i < S n → j < S n →
compare i j sig n ⊨ R_compare i j sig n.
-#i #j #sig #n #Hneq #Hi #Hj @WRealize_to_Realize /2/
+#i #j #sig #n #Hneq #Hi #Hj @WRealize_to_Realize
+ [/2/| @wsem_compare // ]
qed.
∀ls0,y,rs0.nth dst ? int (niltape ?) = midtape sig ls0 y rs0 →
outt = int).
+(*
theorem accRealize_to_Realize :
∀sig,n.∀M:mTM sig n.∀Rtrue,Rfalse,acc.
M ⊨ [ acc: Rtrue, Rfalse ] → M ⊨ Rtrue ∪ Rfalse.
cases (true_or_false (cstate sig (states sig n M) n outc == acc)) #Hcase
[ % @Htrue @(\P Hcase) | %2 @Hfalse @(\Pf Hcase) ]
qed.
+*)
lemma sem_rewind : ∀src,dst,sig,n.
src ≠ dst → src < S n → dst < S n →
[ #ta #tb #tc * lapply (refl ? (current ? (nth src ? ta (niltape ?))))
cases (current ? (nth src ? ta (niltape ?))) in ⊢ (???%→%);
[ #Hcurta_src #Hcomp #_ * #td * >Hcomp [| % %2 %]
- whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
- >(?:nth src ? (current_chars ?? ta) (None ?) = None ?)
- [ normalize in ⊢ (%→?); #H destruct (H)
- | @daemon ]
+ whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
+ >nth_current_chars >Hcurta_src normalize in ⊢ (%→?); #H destruct (H)
| #s #Hs lapply (refl ? (current ? (nth dst ? ta (niltape ?))))
cases (current ? (nth dst ? ta (niltape ?))) in ⊢ (???%→%);
[ #Hcurta_dst #Hcomp #_ * #td * >Hcomp [| %2 %]
- whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
- >(?:nth src ? (current_chars ?? ta) (None ?) = Some ? s) [|@daemon]
- >(?:nth dst ? (current_chars ?? ta) (None ?) = None ?) [|@daemon]
+ whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
+ >nth_current_chars >nth_current_chars >Hs >Hcurta_dst
normalize in ⊢ (%→?); #H destruct (H)
| #s0 #Hs0
cases (current_to_midtape … Hs) #ls * #rs #Hmidta_src >Hmidta_src
[ lapply (\P Hss0) -Hss0 #Hss0 destruct (Hss0)
#_ #Hcomp cases (Hcomp ????? (refl ??) (refl ??)) -Hcomp [ *
[ * #rs' * #_ #Hcurtc_dst * #td * whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
- >(?:nth dst ? (current_chars ?? tc) (None ?) = None ?) [|@daemon]
- cases (nth src ? (current_chars ?? tc) (None ?))
- [| #x ] normalize in ⊢ (%→?); #H destruct (H)
+ >nth_current_chars >nth_current_chars >Hcurtc_dst
+ cases (current ? (nth src …)) [| #x ]
+ normalize in ⊢ (%→?); #H destruct (H)
| * #rs0' * #_ #Hcurtc_src * #td * whd in ⊢ (%→?); * whd in ⊢ (??%?→?);
- >(?:nth src ? (current_chars ?? tc) (None ?) = None ?) [|@daemon]
+ >(?:nth src ? (current_chars ?? tc) (None ?) = None ?)
+ [|>nth_current_chars >Hcurtc_src >nth_change_vec_neq
+ [>nth_change_vec [cases (append ???) // | @Hsrc]
+ |@(not_to_not … Hneq) //
+ ]]
normalize in ⊢ (%→?); #H destruct (H) ]
| * #xs * #ci * #cj * #rs'' * #rs0' * * * #Hcicj #Hrs #Hrs0
#Htc * #td * * #Hmatch #Htd destruct (Htd) * #te * *
| >(?:tc=ta) in Htest;
[|@Hcomp1 % % >Hta_src >Hta_dst @(not_to_not ??? (\Pf Hxx0)) normalize
#Hxx0' destruct (Hxx0') % ]
- whd in ⊢ (??%?→?); >(?:nth src ? (current_chars ?? ta) (None ?) = Some ? x)
- [| @daemon ]
- >(?:nth dst ? (current_chars ?? ta) (None ?) = Some ? x0) [|@daemon]
+ whd in ⊢ (??%?→?);
+ >nth_current_chars >Hta_src >nth_current_chars >Hta_dst
whd in ⊢ (??%?→?); #Hfalse destruct (Hfalse) ] -Hcomp1
cases (Hcomp2 … Hta_src Hta_dst) [ *
[ * #rs' * #Hxs #Hcurtc % %2 %{ls0} %{rs0} %{rs'} % // % //
| * #rs0' * #Hxs #Htc %2 >Htc %{ls0} %{rs0'} % // ]
| * #xs0 * #ci * #cj * #rs' * #rs0' * * *
#Hci #Hxs #Hrs0 #Htc @False_ind
- whd in Htest:(??%?);
- >(?:nth src ? (current_chars ?? tc) (None ?) = Some ? ci) in Htest; [|@daemon]
- >(?:nth dst ? (current_chars ?? tc) (None ?) = Some ? cj) [|@daemon]
+ whd in Htest:(??%?);
+ >(?:nth src ? (current_chars ?? tc) (None ?) = Some ? ci) in Htest;
+ [|>nth_current_chars >Htc >nth_change_vec_neq [|@(not_to_not … Hneq) //]
+ >nth_change_vec //]
+ >(?:nth dst ? (current_chars ?? tc) (None ?) = Some ? cj)
+ [|>nth_current_chars >Htc >nth_change_vec //]
normalize #H destruct (H) ] ] ]
qed.
[ #Hcursrc %{2} %
[| % [ %
[ whd in ⊢ (??%?); >parmove_q0_q2_null_src /2/
- <(nth_vec_map ?? (current …) src ? int (niltape ?)) //
| normalize in ⊢ (%→?); #H destruct (H) ]
| #_ % // % %2 // ] ]
| #a #Ha cases (true_or_false (is_sep a)) #Hsep
[ %{2} %
[| % [ %
[ whd in ⊢ (??%?); >(parmove_q0_q2_sep … Hsep) /2/
- <(nth_vec_map ?? (current …) src ? int (niltape ?)) //
| normalize in ⊢ (%→?); #H destruct (H) ]
| #_ % // % % %{a} % // ] ]
| lapply (refl ? (current ? (nth dst ? int (niltape ?))))
[ #Hcurdst %{2} %
[| % [ %
[ whd in ⊢ (??%?); >(parmove_q0_q2_null_dst … Hsep) /2/
- [ <(nth_vec_map ?? (current …) dst ? int (niltape ?)) //
- | <(nth_vec_map ?? (current …) src ? int (niltape ?)) // ]
| normalize in ⊢ (%→?); #H destruct (H) ]
| #_ % // %2 // ] ]
| #b #Hb %{2} %
[| % [ %
[whd in ⊢ (??%?); >(parmove_q0_q1 … Hneq Hsrc Hdst ? b ?? Hsep) //
- [ <(nth_vec_map ?? (current …) dst ? int (niltape ?)) //
- | <(nth_vec_map ?? (current …) src ? int (niltape ?)) // ]
| #_ %{a} %{b} % // % // % // ]
| * #H @False_ind @H % ]
]]]]