annotate agda/regop.agda @ 89:e919e82e95a2

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 10 Nov 2019 12:21:44 +0900
parents 9406c2571fe7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
1 module regop where
0
e5aa1cf746cb automaton lecture
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
3 open import automaton
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
4
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
5 -- open import Level renaming ( suc to succ ; zero to Zero )
2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
6 open import Data.Nat
13
02b4ecc9972c start exp version of subset construction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
7 open import Data.List
02b4ecc9972c start exp version of subset construction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
8 open import Data.Maybe
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
9 open import Data.Product
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
10 open import Data.Bool using ( Bool ; true ; false ; _∧_ )
3
3ac6311293ec εAutomaton
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
11 open import Relation.Binary.PropositionalEquality hiding ( [_] )
9
e7bb980408fb separate epsiron
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
12 open import Relation.Nullary using (¬_; Dec; yes; no)
0
e5aa1cf746cb automaton lecture
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
e5aa1cf746cb automaton lecture
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
15 union : {Q1 Q2 Σ : Set } → ( M1 : Automaton Q1 Σ) ( M2 : Automaton Q2 Σ) → Automaton (Q1 × Q2) Σ
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
16 union {Q1} {Q2} {Σ} M1 M2 = record {
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
17 δ = δ
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
18 ; astart = astart
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
19 ; aend = aend
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
20 } where
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
21 δ : (Q1 × Q2) → Σ → (Q1 × Q2)
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
22 δ = {!!}
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
23 astart : (Q1 × Q2)
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
24 astart = {!!}
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
25 aend : (Q1 × Q2) → Bool
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
26 aend = {!!}
0
e5aa1cf746cb automaton lecture
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
28 data _∨_ (A B : Set) : Set where
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
29 p1 : A → A ∨ B
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
30 p2 : B → A ∨ B
0
e5aa1cf746cb automaton lecture
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
24
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
32 union← : {Q1 Q2 Σ : Set } → ( M1 : Automaton Q1 Σ) ( M2 : Automaton Q2 Σ) →
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
33 ∀ ( s : List Σ ) → accept ( union M1 M2 ) s ≡ true → ( ( accept M1 s ≡ true ) ∨ ( accept M2 s ≡ true) )
9406c2571fe7 naccept1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
34 union← {Q1} {Q2} {Σ} M1 M2 s eq = {!!}