SlideShare a Scribd company logo
Deterministic Finite Automata
Definition: A deterministic finite automaton (DFA) consists of
1. a finite set of states (often denoted Q)
2. a finite set  of symbols (alphabet)
3. a transition function that takes as argument a state and a
symbol and returns a state (often denoted )
4. a start state often denoted q0
5. a set of final or accepting states (often denoted F )
We have q 0  Q and F  Q
Deterministic Finite Automata
So a DFA is mathematically represented as a 5-uple
(Q, , , q 0, F )
The transition function  is a function in
Q ×   Q
Q ×  is the set of 2-tuples (q, a) with q  Q and a  
Deterministic Finite Automata
How to present a DFA? With a transition table
 0q
 1q
q2
0
q2
q1
q2
1
q0
q1
q1
The  indicates the start state: here q0
The  indicates the final state(s) (here only one final state q 1)
This defines the following transition diagram
1 0
0 1q0 q
2
q1 0 1,
Deterministic Finite Automata
For this example
Q = {q 0, q 1, q 2}
start state q0
F = {q 1}
 = {0, 1}
 is a function from Q ×  to Q
 : Q ×   Q
 (q 0, 1) = q0
 (q 0, 0) = q2
Example: password
When does the automaton accepts a word??
It reads the word and accepts it if it stops in an accepting state
t h e nq0
6 t
q5
=
q
1
q2 q3 q4
6 h= 6 e=
6 n=
Only the word then is accepted
Here Q = { 0q , q 1, q 2, q 3, q 4}
 is the set of all characters
F = {q 4}
We have a "stop" or "dead" state q 5, not accepting
How a DFA Processes Strings
Let us build an automaton that accepts the words that contain 01
as a subword
 = {0, 1}
L = {x01y | x, y   }
We use the following states
A: start
B: the most recent input was 1 (but not 01 yet)
C: the most recent input was 0 (so if we get a 1 next we should go
to the accepting state D)
D: we have encountered 01 (accepting state)
We get the following automaton
1
1
A B
0
0
0
C
1
D 0 1,
Transition table
A
B
C
D
0
C
C
C
D
1
B
B
D
D
Q = {A,B,C,D},  = {0,1}, start state A, final state(s) {D}
Extending the Transition Function to Strings
In the previous example, what happens if we get 011? 100? 10101?
We define ˆ(q, x) by induction
ˆ : Q ×    Q
BASIS ˆ(q, ,) = q for |x| = 0
INDUCTION suppose x = ay (y is a string, a is a symbol)
 (ˆq , ay) = ˆ((q, a), y)
Notice that if x = a we have
 (ˆq , a) = (q, a) since a = a, and ˆ((q, a), ,) = (q, a)
ˆ
Extending the Transition Function to Strings
: Q ×    Q
We write q.x instead of ˆ(q, x)
We can now define mathematically the language accepted by a
given automaton Q, , , q 0, F
L = {x    | q 0.x  F }
On the previous example 100 is not accepted and 10101 is accepted
Minimalisation
The same language may be represented by diferent DFA
1
0
1 0 1
A B
0
C D 0 1,
and
1
0
A
0
B
1
C 0 1,
Minimalisation
Later in the course we shall show that there is only one machine
with the minimum number of states (up to renaming of states)
Furthermore, there is a (clever) algorithm which can find this
minimal automaton given an automaton for a language
Mn
Example
the "cyclic" automaton with n states on  = {1} such that
l
L (M n) = {1 | n divides l}
Functional representation: Version 1
Q = A|B|C and E = 0|1 and W = [E]
One function next : Q × E  Q
next (A, 1) = A, next (A, 0) = B
next (B, 1) = C, next (B, 0) = B
next (C, b) = C
One function run : Q × W  Q
run (q, b : x) = run (next (q, b), x),
accept x = final (run (A, x)) where
final A = final B = F alse,
run (q, []) = q
final C = T rue
E = 0|1,
Functional representation: Version 2
W = [E]
Three functions F A, F B, FC
FA
FB
FC
(1 : x) = FA x,
(1 : x) = FC x,
(1 : x) = FC x,
FA
FB
FC
: W  Bool
(0 : x) = FB x,
(0 : x) = FB x,
(0 : x) = FC x,
FA
FB
FC
[] = F alse
[] = F alse
[] = T rue
We have a mutual recursive definition of 3 functions
Functional representation: Version 3
data Q = A | B | C
data E = O | I
next :: Q -> E -> Q
next A I = A
next A O = B
next B I = C
next B O = B
next C _ = C
run :: Q -> [E] -> Q
run q (b:x) = run (next q b) x
run q [] = q
Functional representation: Version 3
accept :: [E] -> Bool
accept x = final (run A x)
final :: Q -> Bool
final A = False
final B = False
final C = True
Functional representation: Version 4
We have
Q -> E -> Q ~
~
Q x E -> Q
E -> (Q -> Q)
Functional representation: Version 4
data Q = A | B | C
data E = O | I
next :: E -> Q -> Q
next I A = A
next O A = B
next I B = C
next O B = B
next _ C = C
run :: Q -> [E] -> Q
run q (b:x) = run (next b q) x
run q [] = q
Functional representation: Version 4
-- run q [b1,...,bn] is
-- next bn (next b(n-1) (... (next b1 q)...))
-- run = foldl next
A proof by induction
A very important result, quite intuitive, is the following.
Theorem: for any state q and any word x and y we have
q.(xy) = (q.x).y
Proof by induction on x. We prove that: for all q we have
q.(xy) = (q.x).y (notice that y is fixed)
Basis: x = , then q.(xy) = q.y = (q.x).y
Induction step: we have x = az and we assume q 0.(zy) = (q 0.z).y
for all q0
The other definition of ˆ
Recall that a(b(cd)) = ((ab)c)d; we have two descriptions of words
We define ˆ0 (q, ,) = q and
 (0ˆq, xa) = (ˆ0 (q, x), a)
Theorem: We have q.x = ˆ(q, x) = ˆ0 (q, x) for all x
The other definition of ˆ
Indeed we have proved
q., = q and q.(xy) = (q.x).y
As a special case we have q.(xa) = (q.x).a
This means that we have two functions f(x) = q.x and
g (x) = ˆ0 (q, x) which satisfy
f (,) = g(,) = q and
f (xa) = f(x).a g (xa) = g(x).a
Hence f(x) = g(x) for all x that is q.x = ˆ0 (q, x)
Automatic Theorem Proving
f(0) = h(0) = 0, g(0) = 1
f (n + 1) = g(n), g(n + 1) = f(n), h(n + 1) = 1  h(n)
We have f(n) = h(n)
We can prove this automatically using DFA
Automatic Theorem Proving
We have 8 states: Q = {0, 1} × {0, 1} × {0, 1}
We have only one action  = {1} and ((a, b, c), s) = (b, a, 1  c)
The initial state is (0, 1, 0) = (f(0), g(0), h(0))
Then we have (0, 1, 0).1n = (f(n), g(n), h(n))
We check that all accessible states satisfy a = c (that is, the
property a = c is an invariant for each transition of the automata)
Automatic Theorem Proving
A more complex example
f(0) = 0
f(2) = 1
f(1) = 1
f(3) = 0
f (n + 2) = f(n) + f(n + 1)  f(n)f(n + 1)
f(4) = 1 f(5) = 1 . . .
Show that f(n + 3) = f(n) by using Q = {0, 1} × {0, 1} × {0, 1}
and the transition function (a, b, c) 7 (b, c, b + c  bc) with the
initial state (0, 1, 1)
Product of automata
How do we represent interaction between machines?
This is via the product operation
There are diferent kind of products
We may then have combinatorial explosion: the product of n
automata with 2 states has 2n states!
Product of automata (example)
p0
The product of p1 A B p1 and
p0
p1 p0
p0 C D p0 is
p1
p1
A, C
p1
A, D
p0
B, C
p1
B, D
p1
p0
p0
If we start from A, C and after the word w we are in the state A,D
we know that w contains an even number of p 0s and odd number of
p 1s
Product of automata (example)
Model of a system of users that have three states I(dle),
R(equesting) and U(sing). We have two users for k = 1 or k = 2
Each user is represented by a simple automaton
rk
ik
uk
Product of automata (example)
The complete system is represented by the product of these two
automata; it has 3 × 3 = 9 states
i1 , i2 r1 , i2 u1 , i2
i1 , r2 r1 , r2 u1 , r2
i1 , u2 r1 , u2 u1 , u2
The Product Construction
Given A 1 = (Q 1, ,  1, q 1, F 1) and A 2 = (Q 2, ,  2, q 2, F 2) two DFAs
with the same alphabet  we can define the product A = A 1 × A2
set of state Q = Q 1 × Q2
transition function (r 1, r 2).a = (r 1.a, r 2.a)
intial state q 0 = (q 1, q 2)
accepting states F = F 1 × F2
The Product Construction
Lemma: (r 1, r 2).x = (r 1.x, r 2.x)
We prove this by induction
BASE: the statement holds for x = ,
STEP: if the statement holds for y it holds for x = ya
The Product Construction
Theorem: L(A 1 × A 2) = L(A 1)  L(A 2)
Proof: We have ( 1q , q 2).x = (q 1.x, q 2.x) in F if q 1.x  F1 and
q 2.x  F 2, that is x  L(A 1) and x  L(A 2)
Example: let Mk be the "cyclic" automaton that recognizes
multiple of k, such that L(M k) = {an
M 6 × M 9 ' M18
| k divides n}, then
Notice that 6 divides k and 9 divides k if 18 divides k
Product of automata
It can be quite difcult to build automata directly for the
intersection of two regular languages
Example: build a DFA for the language that contains the subword
ab twice and an even number of a's
Variation on the product
We define A 1 ⊕ A2
accepting state
as A 1 × A2 but we change the notion of
(r 1, r 2) accepting if r 1  F1
Theorem: If A1 and A2
or r 2  F2
are DFAs, then
L (A 1 ⊕ A 2) = L(A 1)  L(A 2)
Example: multiples of 3 or of 5 by taking M 3 ⊕ M5
Complement
If A = (Q, , , q 0, F ) we define the complement A ¯ of A as the
automaton
¯ = (Q, , , q 0, Q  F )
Theorem: If A is a DFA, then L( ¯A) =    L(A)
Remark: We have A ⊕ A 0 = A × A0
A
Languages
Given an alphabet 
A language is simply a subset of 
Common languages, programming languages, can be seen as sets of
words
Definition: A language L   is regular if there exists a DFA
A , on the same alphabet  such that L = L(A)
Theorem: If L 1, L2 are regular then so are
L 1  L 2, L 1  L 2,    L1
Remark: Accessible Part of a DFA
Consider the following DFA
0 0
q0
0
1
q1
1
q2
0
0
q3
1
it is clear that it accepts the same language as the DFA
0
q0
0
1
q1
1
which is the accessible part of the DFA
The remaining states are not accessible from the start state and
can be removed
Remark: Accessible Part of a DFA
The set
Acc = {q 0.x | x   }
is the set of accessible states of the DFA (states that are accessible
from the state q 0)
Remark: Accessible Part of a DFA
Proposition: If A = (Q, , , q 0, F ) is a DFA then and
A0
Proof: It is clear that A 0 is well defined and that L(A 0)  L(A).
If x  L(A) then we have q 0.x  F and also q 0.x  Acc. Hence
q 0.x  F  Acc and x  L(A 0).
= (Q  Acc, , , q 0, F  Acc) is a DFA such that L(A) = L(A 0).
Automatic Theorem Proving
Take  = {a, b}.
Define L set of x    such that any a in x is followed by a b
Define L 0 set of x    such that any b in x is followed by a a
Then L  L 0 = {,}
Intuitively if x 6= , in L we have
. . . a . . .  . . . a . . . b . . .
if x in L 0 we have
. . . b . . .  . . . b . . . a . . .
Automatic Theorem Proving
We should have L  L 0 = {,} since a nonempty word in L  L0
should be infinite
We can prove this automatically with automata!
L is regular: write a DFA A for L
L 0 is regular: write a DFA A 0 for L
We can then compute A × A 0 and check that
L  L 0 = L(A × A ) = {,} 0
Application: control system
We have several machines working concurrently
We need to forbid some sequence of actions. For instance, if we
have two machines MA and MB, we may want to say that MB
cannot be on when MA is on. The alphabets will contain: onA,
ofA, onB, ofB
Between onA, on2 there should be at least one ofA
The automaton expressing this condition is
6=onA,onB
p0
onB ofB
p3
ofA
onA
6=onB,ofA
p1
onB
p2
onA
Application: control system
What is interesting is that we can use the product construction to
combine several conditions
For instance, another condition maybe that onA should appear
before onB appear. One automaton representing this condition is
6=onA,onB
q0
onB
q2
onA
q1
We can take the product of the two automata to express the two
conditions as one automaton, which may represent the control
system
Ad

More Related Content

What's hot (20)

Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
residue
residueresidue
residue
Rob Arnold
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
Traian Rebedea
 
Linear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent SetLinear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent Set
Dhaval Shukla
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
Traian Rebedea
 
Time complexity
Time complexityTime complexity
Time complexity
Katang Isip
 
Lec4
Lec4Lec4
Lec4
Anjneya Varshney
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
Kiran K
 
Lec5
Lec5Lec5
Lec5
Anjneya Varshney
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
lavishka_anuj
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
Ravi Jindal
 
Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dag
Kiran K
 
Signals and Systems Assignment Help
Signals and Systems Assignment HelpSignals and Systems Assignment Help
Signals and Systems Assignment Help
Matlab Assignment Experts
 
Lec10
Lec10Lec10
Lec10
Anjneya Varshney
 
Bellman ford
Bellman fordBellman ford
Bellman ford
Kiran K
 
Signals and systems assignment help
Signals and systems assignment helpSignals and systems assignment help
Signals and systems assignment help
Matlab Assignment Experts
 
Linear transformation.ppt
Linear transformation.pptLinear transformation.ppt
Linear transformation.ppt
Raj Parekh
 
Chapter2b
Chapter2bChapter2b
Chapter2b
MaeEstherMaguadMaralit
 
Vector space
Vector spaceVector space
Vector space
Jaimin Patel
 
Definition ofvectorspace
Definition ofvectorspaceDefinition ofvectorspace
Definition ofvectorspace
Tanuj Parikh
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
Traian Rebedea
 
Linear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent SetLinear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent Set
Dhaval Shukla
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
Traian Rebedea
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
Kiran K
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
lavishka_anuj
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
Ravi Jindal
 
Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dag
Kiran K
 
Bellman ford
Bellman fordBellman ford
Bellman ford
Kiran K
 
Linear transformation.ppt
Linear transformation.pptLinear transformation.ppt
Linear transformation.ppt
Raj Parekh
 
Definition ofvectorspace
Definition ofvectorspaceDefinition ofvectorspace
Definition ofvectorspace
Tanuj Parikh
 

Viewers also liked (20)

Basic idea of set theory
Basic idea of set theoryBasic idea of set theory
Basic idea of set theory
siakk
 
Set theory
Set theorySet theory
Set theory
abigail Dayrit
 
Set theory
Set theorySet theory
Set theory
Gaditek
 
Discreet_Set Theory
Discreet_Set TheoryDiscreet_Set Theory
Discreet_Set Theory
guest68d714
 
Los ocho mil
Los ocho milLos ocho mil
Los ocho mil
Carlos Colomer
 
Internet safety
Internet safetyInternet safety
Internet safety
martdale
 
El raval xxv anys 2
El raval xxv anys 2El raval xxv anys 2
El raval xxv anys 2
Joanvi Sempere
 
מערך הפרקים ורציונל היחידה
מערך הפרקים ורציונל היחידהמערך הפרקים ורציונל היחידה
מערך הפרקים ורציונל היחידה
יהודה שלגר
 
Argazki literatura aurkezpena
Argazki literatura aurkezpenaArgazki literatura aurkezpena
Argazki literatura aurkezpena
ariolari
 
Edificios raros, Strange Buildings
Edificios raros, Strange BuildingsEdificios raros, Strange Buildings
Edificios raros, Strange Buildings
Carlos Colomer
 
1st Quarter 2012, EMEA TPI Index
1st Quarter 2012, EMEA TPI Index1st Quarter 2012, EMEA TPI Index
1st Quarter 2012, EMEA TPI Index
Information Services Group (ISG)
 
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Infrastructure Facility
 
SMART Seminar: Governance of Integrated Infrastructure
SMART Seminar: Governance of Integrated InfrastructureSMART Seminar: Governance of Integrated Infrastructure
SMART Seminar: Governance of Integrated Infrastructure
SMART Infrastructure Facility
 
Presentació edu ca2rs_v03
Presentació edu ca2rs_v03Presentació edu ca2rs_v03
Presentació edu ca2rs_v03
EduCA2rs
 
Uib Value Proposition Us
Uib Value Proposition UsUib Value Proposition Us
Uib Value Proposition Us
SreenivasBash
 
Proyectos
ProyectosProyectos
Proyectos
JORGESTALINVILCACUNDOVARGAS
 
Engineering Services Forum - Closing Summary
Engineering Services Forum - Closing SummaryEngineering Services Forum - Closing Summary
Engineering Services Forum - Closing Summary
Information Services Group (ISG)
 
3Q16 EMEA ISG Index
3Q16 EMEA ISG Index3Q16 EMEA ISG Index
3Q16 EMEA ISG Index
Information Services Group (ISG)
 
Sic 2012 gosria presentation 24 may
Sic 2012 gosria presentation 24 maySic 2012 gosria presentation 24 may
Sic 2012 gosria presentation 24 may
Information Services Group (ISG)
 
James Earl Hamilton Marsden - Ancestors
James Earl Hamilton Marsden - AncestorsJames Earl Hamilton Marsden - Ancestors
James Earl Hamilton Marsden - Ancestors
marshamilton
 
Basic idea of set theory
Basic idea of set theoryBasic idea of set theory
Basic idea of set theory
siakk
 
Set theory
Set theorySet theory
Set theory
Gaditek
 
Discreet_Set Theory
Discreet_Set TheoryDiscreet_Set Theory
Discreet_Set Theory
guest68d714
 
Internet safety
Internet safetyInternet safety
Internet safety
martdale
 
מערך הפרקים ורציונל היחידה
מערך הפרקים ורציונל היחידהמערך הפרקים ורציונל היחידה
מערך הפרקים ורציונל היחידה
יהודה שלגר
 
Argazki literatura aurkezpena
Argazki literatura aurkezpenaArgazki literatura aurkezpena
Argazki literatura aurkezpena
ariolari
 
Edificios raros, Strange Buildings
Edificios raros, Strange BuildingsEdificios raros, Strange Buildings
Edificios raros, Strange Buildings
Carlos Colomer
 
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Seminar Series: "Clean Air and Urban Landscapes Hub (CAUL)"
SMART Infrastructure Facility
 
SMART Seminar: Governance of Integrated Infrastructure
SMART Seminar: Governance of Integrated InfrastructureSMART Seminar: Governance of Integrated Infrastructure
SMART Seminar: Governance of Integrated Infrastructure
SMART Infrastructure Facility
 
Presentació edu ca2rs_v03
Presentació edu ca2rs_v03Presentació edu ca2rs_v03
Presentació edu ca2rs_v03
EduCA2rs
 
Uib Value Proposition Us
Uib Value Proposition UsUib Value Proposition Us
Uib Value Proposition Us
SreenivasBash
 
James Earl Hamilton Marsden - Ancestors
James Earl Hamilton Marsden - AncestorsJames Earl Hamilton Marsden - Ancestors
James Earl Hamilton Marsden - Ancestors
marshamilton
 
Ad

Similar to Deterministic finite automata (20)

Teori automata lengkap
Teori automata lengkapTeori automata lengkap
Teori automata lengkap
Muhammad Love Kian
 
Dfa h11
Dfa h11Dfa h11
Dfa h11
Rajendran
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Finite automata
Finite automataFinite automata
Finite automata
Rajesh Yaramadi
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
NAMRATA BORKAR
 
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
Arslan905905
 
Automata Theory
Automata TheoryAutomata Theory
Automata Theory
Jessore University of Science & Technology, Jessore.
 
Fsa
FsaFsa
Fsa
sANKET BASU ROY
 
Theory of Automata(Formal Language) Lecture 3.pptx
Theory of Automata(Formal Language) Lecture 3.pptxTheory of Automata(Formal Language) Lecture 3.pptx
Theory of Automata(Formal Language) Lecture 3.pptx
muhammadanasgc
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
Rushabh2428
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
FariyaTasneem1
 
Microeconomics-Help-Experts.pptx
Microeconomics-Help-Experts.pptxMicroeconomics-Help-Experts.pptx
Microeconomics-Help-Experts.pptx
Economics Homework Helper
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
DFA theroy of computetion Presented by Kawsar.pptx
DFA theroy of computetion Presented by Kawsar.pptxDFA theroy of computetion Presented by Kawsar.pptx
DFA theroy of computetion Presented by Kawsar.pptx
Kamalkaochar1
 
PDA (1) (1).pptx
PDA (1) (1).pptxPDA (1) (1).pptx
PDA (1) (1).pptx
nandan543979
 
Automata
AutomataAutomata
Automata
Gaditek
 
Automata
AutomataAutomata
Automata
Gaditek
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
NAMRATA BORKAR
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
Arslan905905
 
Theory of Automata(Formal Language) Lecture 3.pptx
Theory of Automata(Formal Language) Lecture 3.pptxTheory of Automata(Formal Language) Lecture 3.pptx
Theory of Automata(Formal Language) Lecture 3.pptx
muhammadanasgc
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
Rushabh2428
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
FariyaTasneem1
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
DFA theroy of computetion Presented by Kawsar.pptx
DFA theroy of computetion Presented by Kawsar.pptxDFA theroy of computetion Presented by Kawsar.pptx
DFA theroy of computetion Presented by Kawsar.pptx
Kamalkaochar1
 
Automata
AutomataAutomata
Automata
Gaditek
 
Automata
AutomataAutomata
Automata
Gaditek
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
Ad

More from Muhammad Love Kian (20)

LEASING FACTORING MODAL VENTURA
LEASING FACTORING MODAL VENTURALEASING FACTORING MODAL VENTURA
LEASING FACTORING MODAL VENTURA
Muhammad Love Kian
 
Prototyping model bahasa indonesia
Prototyping model bahasa indonesiaPrototyping model bahasa indonesia
Prototyping model bahasa indonesia
Muhammad Love Kian
 
Deteksi dan koreksi kesalahan lengkap
Deteksi dan koreksi kesalahan lengkapDeteksi dan koreksi kesalahan lengkap
Deteksi dan koreksi kesalahan lengkap
Muhammad Love Kian
 
Sistem operasi input output
Sistem operasi input outputSistem operasi input output
Sistem operasi input output
Muhammad Love Kian
 
Skripsi cahyaningrum bali
Skripsi cahyaningrum baliSkripsi cahyaningrum bali
Skripsi cahyaningrum bali
Muhammad Love Kian
 
7 keajaiban-rezeki
7 keajaiban-rezeki7 keajaiban-rezeki
7 keajaiban-rezeki
Muhammad Love Kian
 
Khusyu itu-mudah abu sangkan
Khusyu itu-mudah abu sangkanKhusyu itu-mudah abu sangkan
Khusyu itu-mudah abu sangkan
Muhammad Love Kian
 
Desain kantor
Desain kantorDesain kantor
Desain kantor
Muhammad Love Kian
 
Tugas soal uas decision making
Tugas soal uas decision makingTugas soal uas decision making
Tugas soal uas decision making
Muhammad Love Kian
 
Skripsi cahyaningrum
Skripsi cahyaningrumSkripsi cahyaningrum
Skripsi cahyaningrum
Muhammad Love Kian
 
Artikel financial-distress-arus-kas-multinomial
Artikel financial-distress-arus-kas-multinomialArtikel financial-distress-arus-kas-multinomial
Artikel financial-distress-arus-kas-multinomial
Muhammad Love Kian
 
Cara memikat wanita_idaman_anda
Cara memikat wanita_idaman_andaCara memikat wanita_idaman_anda
Cara memikat wanita_idaman_anda
Muhammad Love Kian
 
Doa untuk-perniagaan
Doa untuk-perniagaanDoa untuk-perniagaan
Doa untuk-perniagaan
Muhammad Love Kian
 
E book-kwa-kumpulan-asma-jilid-ii2
E book-kwa-kumpulan-asma-jilid-ii2E book-kwa-kumpulan-asma-jilid-ii2
E book-kwa-kumpulan-asma-jilid-ii2
Muhammad Love Kian
 
Cara belajar orang_sukses
Cara belajar orang_suksesCara belajar orang_sukses
Cara belajar orang_sukses
Muhammad Love Kian
 
Maktabah syamilah manual
Maktabah syamilah manualMaktabah syamilah manual
Maktabah syamilah manual
Muhammad Love Kian
 
Skripsi lengkap
Skripsi lengkapSkripsi lengkap
Skripsi lengkap
Muhammad Love Kian
 

Recently uploaded (20)

論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptxUiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
anabulhac
 
Top Hyper-Casual Game Studio Services
Top  Hyper-Casual  Game  Studio ServicesTop  Hyper-Casual  Game  Studio Services
Top Hyper-Casual Game Studio Services
Nova Carter
 
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
UXPA Boston
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Secondary Storage for a microcontroller system
Secondary Storage for a microcontroller systemSecondary Storage for a microcontroller system
Secondary Storage for a microcontroller system
fizarcse
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Best 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat PlatformsBest 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat Platforms
Soulmaite
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Cybersecurity Tools and Technologies - Microsoft Certificate
Cybersecurity Tools and Technologies - Microsoft CertificateCybersecurity Tools and Technologies - Microsoft Certificate
Cybersecurity Tools and Technologies - Microsoft Certificate
VICTOR MAESTRE RAMIREZ
 
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptxIn-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
aptyai
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Vasileios Komianos
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
論文紹介:"InfLoRA: Interference-Free Low-Rank Adaptation for Continual Learning" ...
Toru Tamaki
 
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesRefactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Leon Anavi
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptxUiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptx
anabulhac
 
Top Hyper-Casual Game Studio Services
Top  Hyper-Casual  Game  Studio ServicesTop  Hyper-Casual  Game  Studio Services
Top Hyper-Casual Game Studio Services
Nova Carter
 
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
Longitudinal Benchmark: A Real-World UX Case Study in Onboarding by Linda Bor...
UXPA Boston
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Secondary Storage for a microcontroller system
Secondary Storage for a microcontroller systemSecondary Storage for a microcontroller system
Secondary Storage for a microcontroller system
fizarcse
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Best 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat PlatformsBest 10 Free AI Character Chat Platforms
Best 10 Free AI Character Chat Platforms
Soulmaite
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Cybersecurity Tools and Technologies - Microsoft Certificate
Cybersecurity Tools and Technologies - Microsoft CertificateCybersecurity Tools and Technologies - Microsoft Certificate
Cybersecurity Tools and Technologies - Microsoft Certificate
VICTOR MAESTRE RAMIREZ
 
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptxIn-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
In-App Guidance_ Save Enterprises Millions in Training & IT Costs.pptx
aptyai
 
React Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for SuccessReact Native for Business Solutions: Building Scalable Apps for Success
React Native for Business Solutions: Building Scalable Apps for Success
Amelia Swank
 
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...
Vasileios Komianos
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 

Deterministic finite automata

  • 1. Deterministic Finite Automata Definition: A deterministic finite automaton (DFA) consists of 1. a finite set of states (often denoted Q) 2. a finite set  of symbols (alphabet) 3. a transition function that takes as argument a state and a symbol and returns a state (often denoted ) 4. a start state often denoted q0 5. a set of final or accepting states (often denoted F ) We have q 0  Q and F  Q
  • 2. Deterministic Finite Automata So a DFA is mathematically represented as a 5-uple (Q, , , q 0, F ) The transition function  is a function in Q ×   Q Q ×  is the set of 2-tuples (q, a) with q  Q and a  
  • 3. Deterministic Finite Automata How to present a DFA? With a transition table  0q  1q q2 0 q2 q1 q2 1 q0 q1 q1 The  indicates the start state: here q0 The  indicates the final state(s) (here only one final state q 1) This defines the following transition diagram 1 0 0 1q0 q 2 q1 0 1,
  • 4. Deterministic Finite Automata For this example Q = {q 0, q 1, q 2} start state q0 F = {q 1}  = {0, 1}  is a function from Q ×  to Q  : Q ×   Q  (q 0, 1) = q0  (q 0, 0) = q2
  • 5. Example: password When does the automaton accepts a word?? It reads the word and accepts it if it stops in an accepting state t h e nq0 6 t q5 = q 1 q2 q3 q4 6 h= 6 e= 6 n= Only the word then is accepted Here Q = { 0q , q 1, q 2, q 3, q 4}  is the set of all characters F = {q 4} We have a "stop" or "dead" state q 5, not accepting
  • 6. How a DFA Processes Strings Let us build an automaton that accepts the words that contain 01 as a subword  = {0, 1} L = {x01y | x, y   } We use the following states A: start B: the most recent input was 1 (but not 01 yet) C: the most recent input was 0 (so if we get a 1 next we should go to the accepting state D) D: we have encountered 01 (accepting state)
  • 7. We get the following automaton 1 1 A B 0 0 0 C 1 D 0 1, Transition table A B C D 0 C C C D 1 B B D D Q = {A,B,C,D},  = {0,1}, start state A, final state(s) {D}
  • 8. Extending the Transition Function to Strings In the previous example, what happens if we get 011? 100? 10101? We define ˆ(q, x) by induction ˆ : Q ×    Q BASIS ˆ(q, ,) = q for |x| = 0 INDUCTION suppose x = ay (y is a string, a is a symbol)  (ˆq , ay) = ˆ((q, a), y) Notice that if x = a we have  (ˆq , a) = (q, a) since a = a, and ˆ((q, a), ,) = (q, a)
  • 9. ˆ Extending the Transition Function to Strings : Q ×    Q We write q.x instead of ˆ(q, x) We can now define mathematically the language accepted by a given automaton Q, , , q 0, F L = {x    | q 0.x  F } On the previous example 100 is not accepted and 10101 is accepted
  • 10. Minimalisation The same language may be represented by diferent DFA 1 0 1 0 1 A B 0 C D 0 1, and 1 0 A 0 B 1 C 0 1,
  • 11. Minimalisation Later in the course we shall show that there is only one machine with the minimum number of states (up to renaming of states) Furthermore, there is a (clever) algorithm which can find this minimal automaton given an automaton for a language
  • 12. Mn Example the "cyclic" automaton with n states on  = {1} such that l L (M n) = {1 | n divides l}
  • 13. Functional representation: Version 1 Q = A|B|C and E = 0|1 and W = [E] One function next : Q × E  Q next (A, 1) = A, next (A, 0) = B next (B, 1) = C, next (B, 0) = B next (C, b) = C One function run : Q × W  Q run (q, b : x) = run (next (q, b), x), accept x = final (run (A, x)) where final A = final B = F alse, run (q, []) = q final C = T rue
  • 14. E = 0|1, Functional representation: Version 2 W = [E] Three functions F A, F B, FC FA FB FC (1 : x) = FA x, (1 : x) = FC x, (1 : x) = FC x, FA FB FC : W  Bool (0 : x) = FB x, (0 : x) = FB x, (0 : x) = FC x, FA FB FC [] = F alse [] = F alse [] = T rue We have a mutual recursive definition of 3 functions
  • 15. Functional representation: Version 3 data Q = A | B | C data E = O | I next :: Q -> E -> Q next A I = A next A O = B next B I = C next B O = B next C _ = C run :: Q -> [E] -> Q run q (b:x) = run (next q b) x run q [] = q
  • 16. Functional representation: Version 3 accept :: [E] -> Bool accept x = final (run A x) final :: Q -> Bool final A = False final B = False final C = True
  • 17. Functional representation: Version 4 We have Q -> E -> Q ~ ~ Q x E -> Q E -> (Q -> Q)
  • 18. Functional representation: Version 4 data Q = A | B | C data E = O | I next :: E -> Q -> Q next I A = A next O A = B next I B = C next O B = B next _ C = C run :: Q -> [E] -> Q run q (b:x) = run (next b q) x run q [] = q
  • 19. Functional representation: Version 4 -- run q [b1,...,bn] is -- next bn (next b(n-1) (... (next b1 q)...)) -- run = foldl next
  • 20. A proof by induction A very important result, quite intuitive, is the following. Theorem: for any state q and any word x and y we have q.(xy) = (q.x).y Proof by induction on x. We prove that: for all q we have q.(xy) = (q.x).y (notice that y is fixed) Basis: x = , then q.(xy) = q.y = (q.x).y Induction step: we have x = az and we assume q 0.(zy) = (q 0.z).y for all q0
  • 21. The other definition of ˆ Recall that a(b(cd)) = ((ab)c)d; we have two descriptions of words We define ˆ0 (q, ,) = q and  (0ˆq, xa) = (ˆ0 (q, x), a) Theorem: We have q.x = ˆ(q, x) = ˆ0 (q, x) for all x
  • 22. The other definition of ˆ Indeed we have proved q., = q and q.(xy) = (q.x).y As a special case we have q.(xa) = (q.x).a This means that we have two functions f(x) = q.x and g (x) = ˆ0 (q, x) which satisfy f (,) = g(,) = q and f (xa) = f(x).a g (xa) = g(x).a Hence f(x) = g(x) for all x that is q.x = ˆ0 (q, x)
  • 23. Automatic Theorem Proving f(0) = h(0) = 0, g(0) = 1 f (n + 1) = g(n), g(n + 1) = f(n), h(n + 1) = 1  h(n) We have f(n) = h(n) We can prove this automatically using DFA
  • 24. Automatic Theorem Proving We have 8 states: Q = {0, 1} × {0, 1} × {0, 1} We have only one action  = {1} and ((a, b, c), s) = (b, a, 1  c) The initial state is (0, 1, 0) = (f(0), g(0), h(0)) Then we have (0, 1, 0).1n = (f(n), g(n), h(n)) We check that all accessible states satisfy a = c (that is, the property a = c is an invariant for each transition of the automata)
  • 25. Automatic Theorem Proving A more complex example f(0) = 0 f(2) = 1 f(1) = 1 f(3) = 0 f (n + 2) = f(n) + f(n + 1)  f(n)f(n + 1) f(4) = 1 f(5) = 1 . . . Show that f(n + 3) = f(n) by using Q = {0, 1} × {0, 1} × {0, 1} and the transition function (a, b, c) 7 (b, c, b + c  bc) with the initial state (0, 1, 1)
  • 26. Product of automata How do we represent interaction between machines? This is via the product operation There are diferent kind of products We may then have combinatorial explosion: the product of n automata with 2 states has 2n states!
  • 27. Product of automata (example) p0 The product of p1 A B p1 and p0 p1 p0 p0 C D p0 is p1 p1 A, C p1 A, D p0 B, C p1 B, D p1 p0 p0 If we start from A, C and after the word w we are in the state A,D we know that w contains an even number of p 0s and odd number of p 1s
  • 28. Product of automata (example) Model of a system of users that have three states I(dle), R(equesting) and U(sing). We have two users for k = 1 or k = 2 Each user is represented by a simple automaton rk ik uk
  • 29. Product of automata (example) The complete system is represented by the product of these two automata; it has 3 × 3 = 9 states i1 , i2 r1 , i2 u1 , i2 i1 , r2 r1 , r2 u1 , r2 i1 , u2 r1 , u2 u1 , u2
  • 30. The Product Construction Given A 1 = (Q 1, ,  1, q 1, F 1) and A 2 = (Q 2, ,  2, q 2, F 2) two DFAs with the same alphabet  we can define the product A = A 1 × A2 set of state Q = Q 1 × Q2 transition function (r 1, r 2).a = (r 1.a, r 2.a) intial state q 0 = (q 1, q 2) accepting states F = F 1 × F2
  • 31. The Product Construction Lemma: (r 1, r 2).x = (r 1.x, r 2.x) We prove this by induction BASE: the statement holds for x = , STEP: if the statement holds for y it holds for x = ya
  • 32. The Product Construction Theorem: L(A 1 × A 2) = L(A 1)  L(A 2) Proof: We have ( 1q , q 2).x = (q 1.x, q 2.x) in F if q 1.x  F1 and q 2.x  F 2, that is x  L(A 1) and x  L(A 2) Example: let Mk be the "cyclic" automaton that recognizes multiple of k, such that L(M k) = {an M 6 × M 9 ' M18 | k divides n}, then Notice that 6 divides k and 9 divides k if 18 divides k
  • 33. Product of automata It can be quite difcult to build automata directly for the intersection of two regular languages Example: build a DFA for the language that contains the subword ab twice and an even number of a's
  • 34. Variation on the product We define A 1 ⊕ A2 accepting state as A 1 × A2 but we change the notion of (r 1, r 2) accepting if r 1  F1 Theorem: If A1 and A2 or r 2  F2 are DFAs, then L (A 1 ⊕ A 2) = L(A 1)  L(A 2) Example: multiples of 3 or of 5 by taking M 3 ⊕ M5
  • 35. Complement If A = (Q, , , q 0, F ) we define the complement A ¯ of A as the automaton ¯ = (Q, , , q 0, Q  F ) Theorem: If A is a DFA, then L( ¯A) =    L(A) Remark: We have A ⊕ A 0 = A × A0 A
  • 36. Languages Given an alphabet  A language is simply a subset of  Common languages, programming languages, can be seen as sets of words Definition: A language L   is regular if there exists a DFA A , on the same alphabet  such that L = L(A) Theorem: If L 1, L2 are regular then so are L 1  L 2, L 1  L 2,    L1
  • 37. Remark: Accessible Part of a DFA Consider the following DFA 0 0 q0 0 1 q1 1 q2 0 0 q3 1 it is clear that it accepts the same language as the DFA 0 q0 0 1 q1 1 which is the accessible part of the DFA The remaining states are not accessible from the start state and can be removed
  • 38. Remark: Accessible Part of a DFA The set Acc = {q 0.x | x   } is the set of accessible states of the DFA (states that are accessible from the state q 0)
  • 39. Remark: Accessible Part of a DFA Proposition: If A = (Q, , , q 0, F ) is a DFA then and A0 Proof: It is clear that A 0 is well defined and that L(A 0)  L(A). If x  L(A) then we have q 0.x  F and also q 0.x  Acc. Hence q 0.x  F  Acc and x  L(A 0). = (Q  Acc, , , q 0, F  Acc) is a DFA such that L(A) = L(A 0).
  • 40. Automatic Theorem Proving Take  = {a, b}. Define L set of x    such that any a in x is followed by a b Define L 0 set of x    such that any b in x is followed by a a Then L  L 0 = {,} Intuitively if x 6= , in L we have . . . a . . .  . . . a . . . b . . . if x in L 0 we have . . . b . . .  . . . b . . . a . . .
  • 41. Automatic Theorem Proving We should have L  L 0 = {,} since a nonempty word in L  L0 should be infinite We can prove this automatically with automata! L is regular: write a DFA A for L L 0 is regular: write a DFA A 0 for L We can then compute A × A 0 and check that L  L 0 = L(A × A ) = {,} 0
  • 42. Application: control system We have several machines working concurrently We need to forbid some sequence of actions. For instance, if we have two machines MA and MB, we may want to say that MB cannot be on when MA is on. The alphabets will contain: onA, ofA, onB, ofB Between onA, on2 there should be at least one ofA The automaton expressing this condition is 6=onA,onB p0 onB ofB p3 ofA onA 6=onB,ofA p1 onB p2 onA
  • 43. Application: control system What is interesting is that we can use the product construction to combine several conditions For instance, another condition maybe that onA should appear before onB appear. One automaton representing this condition is 6=onA,onB q0 onB q2 onA q1 We can take the product of the two automata to express the two conditions as one automaton, which may represent the control system
  翻译: