- | #ls #x #xs #ci #rs #ls0 #cj #rs0 #_ #_ #Hnthi #Hnthj
- >Hnthi in Hcicj; >Hnthj normalize in ⊢ (%→?); * #H @False_ind @H %
- ]
- | #Hci #Houtc %
- [ #_ @Houtc
- | #ls #x #xs #ci #rs #ls0 #cj #rs0 #Hnthi >Hnthi in Hci;
- normalize in ⊢ (%→?); #H destruct (H) ] ]
- | #Hcj #Houtc %
- [ #_ @Houtc
- | #ls #x #xs #ci #rs #ls0 #cj #rs0 #_ #Hnthj >Hnthj in Hcj;
- normalize in ⊢ (%→?); #H destruct (H) ] ]
-
-
-
-[ #tc whd in ⊢ (%→?); * * [ *
-
-*)
-
-definition R_match_m ≝
- λi,j,sig,n,is_startc,is_endc.λint,outt: Vector (tape sig) (S n).
- (((∃x.current ? (nth i ? int (niltape ?)) = Some ? x ∧ is_endc x = true) ∨
- current ? (nth i ? int (niltape ?)) = None ? ∨
- current ? (nth j ? int (niltape ?)) = None ?) → outt = int) ∧
- (∀ls,x,xs,ci,rs,ls0,x0,rs0.
- is_startc x = true → is_endc ci = true →
- (∀c0.c0 ∈ (x::xs) = true → is_endc c0 = false) →
- nth i ? int (niltape ?) = midtape sig ls x (xs@ci::rs) →
- nth j ? int (niltape ?) = midtape sig ls0 x0 rs0 →
- (∃x1. is_endc x1 = false ∧ current ? (nth i ? outt (niltape ?)) = Some ? x1) ∨
- (∃l,cj,l1.x0::rs0 = l@x::xs@cj::l1 ∧
- outt = change_vec ??
- (change_vec ?? int (midtape sig (reverse ? xs@x::ls) ci rs) i)
- (midtape sig ((reverse ? (l@x::xs))@ls0) cj l1) j)).
-
-lemma wsem_match_m : ∀src,dst,sig,n,is_startc,is_endc.
-src ≠ dst → src < S n → dst < S n →
- match_m src dst sig n is_startc is_endc ⊫ R_match_m src dst sig n is_startc is_endc.
-#src #dst #sig #n #is_startc #is_endc #Hneq #Hsrc #Hdst #ta #k #outc #Hloop
-lapply (sem_while … (sem_match_step src dst sig n is_startc is_endc Hneq Hsrc Hdst) … Hloop) //
--Hloop * #tb * #Hstar @(star_ind_l ??????? Hstar) -Hstar
-[ #tc whd in ⊢ (%→?); * #HR1 #HR2 % [ @HR1 ]
- #ls #x #xs #ci #rs #ls0 #x0 #rs0 #Hstartc #Hendc #Hnotendc #Hsrctc #Hdsttc
- cases (comp_list ? (x::xs@ci::rs) (x0::rs0) is_endc)
- #l0 * #l1 * #l2 * * * #Heqsrc #Heqdst #Hnotendsrc #Hor
- cut (∃x1,l1'.l1 = x1::l1') [@daemon] * #x1 * #l1' #Hl1
- cases (Hor ?? Hl1) -Hor
- [
- cases HR2 -HR2 #HR2 [% @HR2]
- |cut (is_endc x1 = false) [@daemon] #Hx1
-
-
- [ * * [ *
- [ * #cur_src * #H1 #H2 #Houtc %
- [ #_ @Houtc
- | #ls #x #xs #ci #rs #ls0 #cj #rs0 #_ #_ #Hnotendc #Hnthsrc
- @False_ind >Hnthsrc in H1;normalize
- #H1 destruct (H1) >(Hnotendc ? (memb_hd …)) in H2; #H2 destruct (H2)