Book: pdf
Q1: T/F, if F explain why. Q4: regular expression, 5 separate q Q2/Q3: DFAs and NFAs
- Product construction: of DFAs
- Subset construction: NFA to DFA
- Quotient construction: State minimization
Set theory
Complement in :
associative:
commutative:
null set
null set is the identity for and annihilator for set concatenation
and
set is an identity for set concatenation
Set union and intersection are distributive over set concatenation
Set concatenation distributes over union
DFA
definition
examples
Ex: . Creates a DFA that accepts all strings that contains at least three a’s.
Transition function:
stateDiagram-v2 direction LR classDef accepting fill:#4CAF50,stroke:#333,stroke-width:2px classDef start fill:#FFD700,stroke:#333,stroke-width:2px s1: s1 s2: s2 s3: s3 s4: s4 [*] --> s1 s1 --> s1: b s1 --> s2: a s2 --> s2: b s2 --> s3: a s3 --> s3: b s3 --> s4: a s4 --> s4: a,b class s4 accepting class s1 start
Lien vers l'originalif in final string then accept, otherwise reject the string
Let , thus
therefore
regularity
Important
Important
a subset is regular if and only if there exists a DFA such that
Important
All finite languages are regular, but not all regular languages are finite
examples
Show is regular where , with
Three states, , where denotes the string mod 3 is 0, denotes the string mod 3 is 1, and denotes the string mod 3 is 2.
, ,
stateDiagram-v2 direction LR [*] --> q0 q0 --> q1 : 1 q0 --> q0 : 0 q1 --> q2 : 0 q1 --> q0 : 1 q2 --> q1 : 0 q2 --> q2 : 1 q0 --> [*]
product construction
Assume that A, B are regular, there are automata
Thus
where , , , and
with and , then is regular.
Lemma 4.1
Complement set:
Trivial machine , ,
De Morgan laws
Theorem 4.2
is regular
is regular
is regular
NFA
subset construction
acceptance
accepts if
Define
Theorem 4.3
Every DFA is equvalent to an NFA where
Lemma 6.1
For any ,
Lemma 6.2
commutes with set union:
Let be arbitrary NFA. Let M be DFA where:
Lemma 6.3
For any
Theorem 6.4
The automata M and N accept the same sets.
regex
atomic patterns are:
- : matched by any symbols
- : matched by any string
compound patterns are formed by combining binary operators and unary operators.
redundancy
,
if and are patterns, then so are
The following holds for x matches:
Theorem 7.1
Singleton set
Finite set:
Theorem 9
quotient automata
also known as DFA state minimization
definition
Define
where (13.1)
Lemma 13.5
If , then equivalently, if , then
Lemma 13.6
Lemma 13.7
Theorem 13.8
algorithm
- Table of all pairs
- Mark all pairs if
- If there exists unmarked pair , such that is marked, then mark
- is not marked