# HG changeset patch # User Shinji KONO # Date 1640929004 -32400 # Node ID 2f113cac060bc6abd87455ee9fab6aab289eb56b # Parent 99c2cbe6a86213a75f917031522ee8565c160b4e ... diff -r 99c2cbe6a862 -r 2f113cac060b automaton-in-agda/src/non-regular.agda --- a/automaton-in-agda/src/non-regular.agda Thu Dec 30 17:42:44 2021 +0900 +++ b/automaton-in-agda/src/non-regular.agda Fri Dec 31 14:36:44 2021 +0900 @@ -105,41 +105,36 @@ open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) -record TA { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) ( q : Q ) (phase yeq : Bool) : Set where +record TA { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) (phase : ℕ) ( q qd : Q ) : Set where field - x y y1 z : List Σ - px : phase ≡ true → x ≡ [] - py : yeq ≡ true → y ≡ y1 - trace0 : Trace fa (x ++ y ++ z) q - trace1 : Trace fa (x ++ y ++ y1 ++ z) q + x y z : List Σ + trace-z : phase > 1 → Trace fa z qd + trace-yz : phase > 0 → Trace fa (y ++ z) qd + trace-xyz : phase ≡ 0 → Trace fa (x ++ y ++ z) q + trace-xyyz : phase ≡ 0 → Trace fa (x ++ y ++ y ++ z) q + +open import nat make-TA : { Q : Set } { Σ : Set } (fa : Automaton Q Σ ) (finq : FiniteSet Q) (q qd : Q) (is : List Σ) → (tr : Trace fa is q ) → dup-in-list finq qd (tr→qs fa is q tr) ≡ true - → TA fa q false true + → TA fa 0 q qd 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 → TA fa q true false + tra-phase2 : (q : Q) → (is : List Σ) → (tr : Trace fa is q ) → phase2 finq qd (tr→qs fa is q tr) ≡ true → TA fa 1 q qd tra-phase2 q (i ∷ is) (tnext q tr) p with equal? finq qd q - ... | true = {!!} -- record { px = λ _ → refl ; x = [] ; y = i ∷ y TA0 ; z = z TA0 ; trace0 = tnext q (trace0 TA0 ) ; trace1 = tnext q (trace1 TA0) } - ... | false = record { px = λ _ → refl ; x = [] ; y = i ∷ y TA0 ; y1 = y1 TA0 ; z = z TA0 ; py = λ () - ; trace0 = tnext q (subst (λ k → Trace fa k (δ fa q i) ) (tr-01 (px TA0 refl ) ) (trace0 TA0)) - ; trace1 = tnext q (subst (λ k → Trace fa k (δ fa q i) ) (tr-02 (px TA0 refl )) (trace1 TA0))} where - TA0 : TA fa (δ fa q i ) true false + ... | true = {!!} + ... | false = {!!} + tra-phase1 : (q : Q) → (is : List Σ) → (tr : Trace fa is q ) → phase1 finq qd (tr→qs fa is q tr) ≡ true → TA fa 0 q qd + tra-phase1 q (i ∷ is) (tnext q tr) p with equal? finq qd q + ... | true = record { x = [] ; y = y TA0 ; z = z TA0 ; trace-z = λ () ; trace-yz = λ _ → trace-yz TA0 an (afin r) nntrace nn05