X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Flib%2Fre%2Fmoves.ma;h=6f6d0a67b4b5101f9dab3b5e49b088698b03f9be;hb=28c261aad4d710c9f218fbbbaf1ed3b45c1caf72;hp=1372b49760ee677eea226d73a3a70392bc869e86;hpb=65a3b93b01f2d00960c56df3563b879f36f3cbfd;p=helm.git diff --git a/matita/matita/lib/re/moves.ma b/matita/matita/lib/re/moves.ma index 1372b4976..6f6d0a67b 100644 --- a/matita/matita/lib/re/moves.ma +++ b/matita/matita/lib/re/moves.ma @@ -30,10 +30,10 @@ lifted operators of the previous section: let rec move (S: DeqSet) (x:S) (E: pitem S) on E : pre S ≝ match E with - [ pz ⇒ 〈 `∅, false 〉 - | pe ⇒ 〈 ϵ, false 〉 - | ps y ⇒ 〈 `y, false 〉 - | pp y ⇒ 〈 `y, x == y 〉 + [ pz ⇒ 〈 pz ?, false 〉 + | pe ⇒ 〈 pe ? , false 〉 + | ps y ⇒ 〈 ps ? y, false 〉 + | pp y ⇒ 〈 ps ? y, x == y 〉 | po e1 e2 ⇒ (move ? x e1) ⊕ (move ? x e2) | pc e1 e2 ⇒ (move ? x e1) ⊙ (move ? x e2) | pk e ⇒ (move ? x e)^⊛ ]. @@ -110,7 +110,7 @@ theorem move_ok: ] qed. -notation > "x ↦* E" non associative with precedence 60 for @{moves ? $x $E}. +notation > "x ↦* E" non associative with precedence 65 for @{moves ? $x $E}. let rec moves (S : DeqSet) w e on w : pre S ≝ match w with [ nil ⇒ e @@ -211,7 +211,7 @@ e1 and e2 are equivalent iff for any word w the states reachable through w are cofinal. *) theorem equiv_sem: ∀S:DeqSet.∀e1,e2:pre S. - \sem{e1} =1 \sem{e2} ↔ ∀w.cofinal ? 〈moves ? w e1,moves ? w e2〉. + \sem{e1} ≐ \sem{e2} ↔ ∀w.cofinal ? 〈moves ? w e1,moves ? w e2〉. #S #e1 #e2 % [#same_sem #w cut (∀b1,b2. iff (b1 = true) (b2 = true) → (b1 = b2)) @@ -244,7 +244,7 @@ occurring the given regular expressions. *) lemma equiv_sem_occ: ∀S.∀e1,e2:pre S. (∀w.(sublist S w (occ S e1 e2))→ cofinal ? 〈moves ? w e1,moves ? w e2〉) -→ \sem{e1}=1\sem{e2}. +→ \sem{e1}≐\sem{e2}. #S #e1 #e2 #H @(proj2 … (equiv_sem …)) @occ_enough #w @H qed. @@ -273,7 +273,7 @@ definition is_bisim ≝ λS:DeqSet.λl:list ?.λalpha:list S. (* Using lemma equiv_sem_occ it is easy to prove the following result: *) lemma bisim_to_sem: ∀S:DeqSet.∀l:list ?.∀e1,e2: pre S. - is_bisim S l (occ S e1 e2) → memb ? 〈e1,e2〉 l = true → \sem{e1}=1\sem{e2}. + is_bisim S l (occ S e1 e2) → memb ? 〈e1,e2〉 l = true → \sem{e1}≐\sem{e2}. #S #l #e1 #e2 #Hbisim #Hmemb @equiv_sem_occ #w #Hsub @(proj1 … (Hbisim 〈moves S w e1,moves S w e2〉 ?)) lapply Hsub @(list_elim_left … w) [//] @@ -428,7 +428,7 @@ uniqueb ? l = true ∧ definition disjoint ≝ λS:DeqSet.λl1,l2. ∀p:S. memb S p l1 = true → memb S p l2 = false. -lemma bisim_correct: ∀S.∀e1,e2:pre S.\sem{e1}=1\sem{e2} → +lemma bisim_correct: ∀S.∀e1,e2:pre S.\sem{e1}≐\sem{e2} → ∀l,n.∀frontier,visited:list ((pre S)×(pre S)). |space_enum S (|\fst e1|) (|\fst e2|)| < n + |visited|→ all_reachable S e1 e2 visited → @@ -544,7 +544,7 @@ definition equiv ≝ λSig.λre1,re2:re Sig. (bisim ? sig n [〈e1,e2〉] []). theorem euqiv_sem : ∀Sig.∀e1,e2:re Sig. - \fst (equiv ? e1 e2) = true ↔ \sem{e1} =1 \sem{e2}. + \fst (equiv ? e1 e2) = true ↔ \sem{e1} ≐ \sem{e2}. #Sig #re1 #re2 % [#H @eqP_trans [|@eqP_sym @re_embedding] @eqP_trans [||@re_embedding] cut (equiv ? re1 re2 = 〈true,\snd (equiv ? re1 re2)〉) @@ -610,10 +610,75 @@ normalize // qed. definition exp10 ≝ a·a·a·a·a·a·a·a·a·a·a·a·(a^* ). definition exp11 ≝ (a·a·a·a·a + a·a·a·a·a·a·a)^*. -example ex2 : \fst (equiv ? (exp10+exp11) exp10) = true. +example ex2 : \fst (equiv ? (exp10+exp11) exp11) = false. normalize // qed. +definition exp12 ≝ + (a·a·a·a·a·a·a·a)·(a·a·a·a·a·a·a·a)·(a·a·a·a·a·a·a·a)·(a^* ). + +example ex3 : \fst (equiv ? (exp12+exp11) exp11) = true. +normalize // qed. +let rec raw (n:nat) ≝ + match n with + [ O ⇒ a + | S p ⇒ a · (raw p) + ]. + +let rec alln (n:nat) ≝ + match n with + [O ⇒ ϵ + |S m ⇒ raw m + alln m + ]. +definition testA ≝ λx,y,z,b. + let e1 ≝ raw x in + let e2 ≝ raw y in + let e3 ≝ (raw z) · a^* in + let e4 ≝ (e1 + e2)^* in + \fst (equiv ? (e3+e4) e4) = b. + +example ex4 : testA 2 4 7 true. +normalize // qed. + +example ex5 : testA 3 4 10 false. +normalize // qed. + +example ex6 : testA 3 4 11 true. +normalize // qed. + +example ex7 : testA 4 5 18 false. +normalize // qed. + +example ex8 : testA 4 5 19 true. +normalize // qed. + +example ex9 : testA 4 6 22 false. +normalize // qed. -\v \ No newline at end of file +example ex10 : testA 4 6 23 true. +normalize // qed. + +definition testB ≝ λn,b. + \fst (equiv ? ((alln n)·((raw n)^* )) a^* ) = b. + +example ex11 : testB 6 true. +normalize // qed. + +example ex12 : testB 8 true. +normalize // qed. + +example ex13 : testB 10 true. +normalize // qed. + +example ex14 : testB 12 true. +normalize // qed. + +example ex15 : testB 14 true. +normalize // qed. + +example ex16 : testB 16 true. +normalize // qed. + +example ex17 : testB 18 true. +normalize // qed.