# HG changeset patch # User Shinji KONO # Date 1572525714 -32400 # Node ID 13822f5f9c859a8dfd6c7cda194fc4f6c8c00269 # Parent b9679ebd115611f7618afd9a88470b721ff83161 use Vec diff -r b9679ebd1156 -r 13822f5f9c85 agda/automaton-text.agda --- a/agda/automaton-text.agda Thu Oct 31 13:53:26 2019 +0900 +++ b/agda/automaton-text.agda Thu Oct 31 21:41:54 2019 +0900 @@ -2,7 +2,7 @@ -- open import Level renaming ( suc to succ ; zero to Zero ) open import Data.Nat -open import Data.List +open import Data.Vec open import Data.Maybe -- open import Data.Bool using ( Bool ; true ; false ; _∧_ ) open import Relation.Binary.PropositionalEquality hiding ( [_] ) @@ -11,6 +11,7 @@ -- open import Data.Bool renaming ( _∧_ to _and_ ; _∨_ to _or ) open import automaton +open import Data.Vec open Automaton @@ -25,6 +26,9 @@ lemma5 {zero} = s≤s z≤n lemma5 {suc n} = s≤s lemma5 +length : {S : Set} {n : ℕ} → Vec S n → ℕ +length {_} {n} _ = n + record accept-n { Q : Set } { Σ : Set } (M : Automaton Q Σ ) (astart : Q ) (n : ℕ ) (s : {i : ℕ } → (i < n) → Σ ) : Set where field r : (i : ℕ ) → i < suc n → Q @@ -32,26 +36,34 @@ accept-2 : (i : ℕ ) → (i