# HG changeset patch # User Shinji KONO # Date 1640948574 -32400 # Node ID 67d8e42b7782f554129cad8b9903cb1738354163 # Parent 841f4064e51585e7309efe274ac2b4957e2efcb7 ... diff -r 841f4064e515 -r 67d8e42b7782 automaton-in-agda/src/non-regular.agda --- a/automaton-in-agda/src/non-regular.agda Fri Dec 31 17:27:58 2021 +0900 +++ b/automaton-in-agda/src/non-regular.agda Fri Dec 31 20:02:54 2021 +0900 @@ -105,11 +105,11 @@ open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) -record TA1 { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) ( q : Q ) (is : List Σ) : Set where +record TA1 { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) ( q qd : Q ) (is : List Σ) : Set where field y z : List Σ yz=is : y ++ z ≡ is - trace-z : Trace fa z q + trace-z : Trace fa z qd trace-yz : Trace fa (y ++ z) q record TA { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) ( q : Q ) (is : List Σ) : Set where @@ -127,34 +127,36 @@ → TA fa q is make-TA {Q} {Σ} fa finq q qd is tr dup = tra-phase1 q is tr dup where open TA - tra-phase2 : (q : Q) → (is : List Σ) → (tr : Trace fa is q ) → phase2 finq qd (tr→qs fa is q tr) ≡ true → TA1 fa q is + tra-phase2 : (q : Q) → (is : List Σ) → (tr : Trace fa is q ) + → phase2 finq qd (tr→qs fa is q tr) ≡ true → TA1 fa q qd is tra-phase2 q (i ∷ is) (tnext q tr) p with equal? finq qd q | inspect ( equal? finq qd) q - ... | true | record { eq = eq } = {!!} - ... | false | record { eq = eq } = {!!} + ... | true | record { eq = eq } = record { y = [] ; z = i ∷ is ; yz=is = refl + ; trace-z = subst (λ k → Trace fa (i ∷ is) k ) (sym (equal→refl finq eq)) (tnext q tr) ; trace-yz = tnext q tr } + ... | false | record { eq = eq } = record { y = i ∷ TA1.y ta ; z = TA1.z ta ; yz=is = cong (i ∷_ ) (TA1.yz=is ta ) + ; trace-z = TA1.trace-z ta ; trace-yz = tnext q ( TA1.trace-yz ta ) } where + ta : TA1 fa (δ fa q i) qd is + ta = tra-phase2 (δ fa q i) is tr p tra-phase1 : (q : Q) → (is : List Σ) → (tr : Trace fa is q ) → phase1 finq qd (tr→qs fa is q tr) ≡ true → TA fa q is tra-phase1 q (i ∷ is) (tnext q tr) p with equal? finq qd q | inspect (equal? finq qd) q | phase1 finq qd (tr→qs fa is (δ fa q i) tr) | inspect ( phase1 finq qd) (tr→qs fa is (δ fa q i) tr) ... | true | record { eq = eq } | false | record { eq = np} = record { x = [] ; y = i ∷ TA1.y ta ; z = TA1.z ta ; xyz=is = cong (i ∷_ ) (TA1.yz=is ta) - ; trace-xyz = {!!} - ; trace-xyyz = {!!} } where --- : phase2 finq qd (tr→qs fa (y ta ++ z ta) qd (trace-yz ta a