+ (sem_seq ??????
+ (sem_if ??????????
+ (sem_test_null_multi ?? obj ?)
+ (sem_seq ?????? (accRealize_to_Realize … (sem_copy_step …))
+ (sem_seq ?????? (sem_move_multi ? 2 cfg L ?)
+ (sem_move_multi ? 2 obj L ?)))
+ (sem_inject ???? cfg ? (sem_write FSUnialpha null)))
+ (sem_seq ?????? (sem_inject ???? cfg ? (sem_move_to_end_l ?))
+ (sem_move_multi ? 2 cfg R ?)))) //
+#ta #tb *
+#tc * whd in ⊢ (%→?); #Htc *
+#td * *
+[ * #te * * #Hcurtc #Hte
+ * destruct (Hte) #te * *
+ [ whd in ⊢ (%→%→?); * #x * #y * * -Hcurtc #Hcurtc1 #Hcurtc2 #Hte
+ * #tf * whd in ⊢ (%→%→?); #Htf #Htd
+ * #tg * * * whd in ⊢ (%→%→%→%→?); #Htg1 #Htg2 #Htg3 #Htb
+ #c #ls #Hta1 %
+ [ #lso #x0 #rso #Hta2 >Hta1 in Htc; >eq_mk_tape_rightof
+ whd in match (tape_move ???); #Htc
+ cut (tg = change_vec ?? td (mk_tape ? [ ] (None ?) (reverse ? ls@[x])) cfg)
+ [@daemon] -Htg1 -Htg2 -Htg3 #Htg destruct (Htg Htf Hte Htd Htc Htb)
+ >change_vec_change_vec >change_vec_change_vec
+ >change_vec_commute // >change_vec_change_vec
+ >change_vec_commute [|@sym_not_eq //] >change_vec_change_vec
+ >change_vec_commute // >change_vec_change_vec
+ >nth_change_vec // >nth_change_vec_neq [|@sym_not_eq //]
+ >nth_change_vec // >nth_change_vec_neq [|@sym_not_eq //]
+ >change_vec_commute [|@sym_not_eq //] @eq_f3 //
+ [ >Hta2 cases rso in Hta2; whd in match (tape_move_mono ???);
+ [ #Hta2 whd in match (tape_move ???); <Hta2 @change_vec_same
+ | #r1 #rs1 #Hta2 whd in match (tape_move ???); <Hta2 @change_vec_same ]
+ | >tape_move_mk_tape_R [| #_ % %] >reverse_cons
+ >nth_change_vec_neq in Hcurtc1; [|@sym_not_eq //] >Hta2
+ normalize in ⊢ (%→?); #H destruct (H) %
+ ]
+ | #Hta2 >Htc in Hcurtc1; >nth_change_vec_neq [| @sym_not_eq //]
+ >Hta2 #H destruct (H)
+ ]
+ | * #Hcurtc0 #Hte #_ #_ #c #ls #Hta1 >Hta1 in Htc; >eq_mk_tape_rightof
+ whd in match (tape_move ???); #Htc >Htc in Hcurtc0; *
+ [ >Htc in Hcurtc; >nth_change_vec_neq [|@sym_not_eq //]
+ #Hcurtc #Hcurtc0 >Hcurtc0 in Hcurtc; * #H @False_ind @H %
+ | >nth_change_vec // normalize in ⊢ (%→?); #H destruct (H) ]
+ ]
+| * #te * * #Hcurtc #Hte
+ * whd in ⊢ (%→%→?); #Htd1 #Htd2
+ * #tf * * * #Htf1 #Htf2 #Htf3 whd in ⊢ (%→?); #Htb
+ #c #ls #Hta1 %
+ [ #lso #x #rso #Hta2 >Htc in Hcurtc; >nth_change_vec_neq [|@sym_not_eq //]
+ >Hta2 normalize in ⊢ (%→?); #H destruct (H)
+ | #_ >Hta1 in Htc; >eq_mk_tape_rightof whd in match (tape_move ???); #Htc
+ destruct (Hte) cut (td = change_vec ?? tc (midtape ? ls null []) cfg)
+ [@daemon] -Htd1 -Htd2 #Htd
+ -Htf1 cut (tf = change_vec ?? td (mk_tape ? [ ] (None ?) (reverse ? ls@[null])) cfg)
+ [@daemon] -Htf2 -Htf3 #Htf destruct (Htf Htd Htc Htb)
+ >change_vec_change_vec >change_vec_change_vec >change_vec_change_vec
+ >change_vec_change_vec >change_vec_change_vec >nth_change_vec //
+ >reverse_cons >tape_move_mk_tape_R /2/ ]
+]
+qed.
+
+definition test_null_char ≝ test_char FSUnialpha (λc.c == null).
+
+definition R_test_null_char_true ≝ λt1,t2.
+ current FSUnialpha t1 = Some ? null ∧ t1 = t2.
+
+definition R_test_null_char_false ≝ λt1,t2.
+ current FSUnialpha t1 ≠ Some ? null ∧ t1 = t2.
+
+lemma sem_test_null_char :
+ test_null_char ⊨ [ tc_true : R_test_null_char_true, R_test_null_char_false].
+#t1 cases (sem_test_char FSUnialpha (λc.c == null) t1) #k * #outc * * #Hloop #Htrue
+#Hfalse %{k} %{outc} % [ %
+[ @Hloop
+| #Houtc cases (Htrue ?) [| @Houtc] * #c * #Hcurt1 #Hcnull lapply (\P Hcnull)
+ -Hcnull #H destruct (H) #Houtc1 %
+ [ @Hcurt1 | <Houtc1 % ] ]
+| #Houtc cases (Hfalse ?) [| @Houtc] #Hc #Houtc %
+ [ % #Hcurt1 >Hcurt1 in Hc; #Hc lapply (Hc ? (refl ??))
+ >(?:((null:FSUnialpha) == null) = true) [|@(\b (refl ??)) ]
+ #H destruct (H)
+ | <Houtc % ] ]
+qed.
+
+definition cfg_to_obj ≝
+ mmove cfg FSUnialpha 2 L ·
+ (ifTM ?? (inject_TM ? test_null_char 2 cfg)
+ (nop ? 2)
+ (copy_step cfg obj FSUnialpha 2 ·
+ mmove cfg FSUnialpha 2 L ·
+ mmove obj FSUnialpha 2 L)
+ tc_true) ·
+ inject_TM ? (move_to_end FSUnialpha L) 2 cfg ·
+ mmove cfg FSUnialpha 2 R.
+
+definition R_cfg_to_obj ≝ λt1,t2:Vector (tape FSUnialpha) 3.
+ ∀c,ls.
+ nth cfg ? t1 (niltape ?) = mk_tape FSUnialpha (c::ls) (None ?) [ ] →
+ (c = null →
+ t2 = change_vec ?? t1
+ (mk_tape ? [ ] (option_hd FSUnialpha (reverse ? (c::ls)))
+ (tail ? (reverse ? (c::ls)))) cfg) ∧
+ (c ≠ null →
+ t2 = change_vec ??
+ (change_vec ?? t1
+ (midtape ? (left ? (nth obj ? t1 (niltape ?))) c (right ? (nth obj ? t1 (niltape ?)))) obj)
+ (mk_tape ? [ ] (option_hd ? (reverse ? (c::ls))) (tail ? (reverse ? (c::ls)))) cfg).
+
+axiom sem_cfg_to_obj : cfg_to_obj ⊨ R_cfg_to_obj.
+(*@(sem_seq_app FSUnialpha 2 ????? (sem_move_multi ? 2 cfg L ?)