SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
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 q0 ∈ Q and F ⊆ Q
1
Deterministic Finite Automata
So a DFA is mathematically represented as a 5-uple
(Q, Σ, δ, q0, F)
The transition function δ is a function in
Q × Σ → Q
Q × Σ is the set of 2-tuples (q, a) with q ∈ Q and a ∈ Σ
2
Deterministic Finite Automata
How to present a DFA? With a transition table
0 1
→q0 q2 q0
∗q1 q1 q1
q2 q2 q1
The → indicates the start state: here q0
The ∗ indicates the final state(s) (here only one final state q1)
This defines the following transition diagram
q0
0
1
q2
1
0
q1 0,1
3
Deterministic Finite Automata
For this example
Q = {q0, q1, q2}
start state q0
F = {q1}
Σ = {0, 1}
δ is a function from Q × Σ to Q
δ : Q × Σ → Q
δ(q0, 1) = q0
δ(q0, 0) = q2
4
Example: password
When does the automaton accepts a word??
It reads the word and accepts it if it stops in an accepting state
q0
t
=t
q1
h
=h
q2
e
=e
q3
n
=n
q4
q5
Only the word then is accepted
Here Q = {q0, q1, q2, q3, q4}
Σ is the set of all characters
F = {q4}
We have a “stop” or “dead” state q5, not accepting
5
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)
6
We get the following automaton
A
1
0
B
1
0
C
1
0
D 0,1
Transition table
0 1
→A C B
B C B
C C D
∗D D D
Q = {A,B,C,D}, Σ = {0,1}, start state A, final state(s) {D}
7
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)
8
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, Σ, δ, q0, F
L = {x ∈ Σ∗
| q0.x ∈ F}
On the previous example 100 is not accepted and 10101 is accepted
9
Minimalisation
The same language may be represented by different DFA
A
1
0
B
1
0
C
1
0
D 0,1
and
A
1
0
B
1
0
C 0,1
10
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
11
Example
Mn the “cyclic” automaton with n states on Σ = {1} such that
L(Mn) = {1l
| n divides l}
12
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), run (q, []) = q
accept x = final (run (A, x)) where
final A = final B = False, final C = True
13
Functional representation: Version 2
E = 0|1, W = [E]
Three functions FA, FB, FC : W → Bool
FA (1 : x) = FA x, FA (0 : x) = FB x, FA [] = False
FB (1 : x) = FC x, FB (0 : x) = FB x, FB [] = False
FC (1 : x) = FC x, FC (0 : x) = FC x, FC [] = True
We have a mutual recursive definition of 3 functions
14
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
15
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
16
Functional representation: Version 4
We have
Q -> E -> Q ~ Q x E -> Q
~ E -> (Q -> Q)
17
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
18
Functional representation: Version 4
-- run q [b1,...,bn] is
-- next bn (next b(n-1) (... (next b1 q)...))
-- run = foldl next
19
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 .(zy) = (q .z).y
for all q
20
The other definition of ˆδ
Recall that a(b(cd)) = ((ab)c)d; we have two descriptions of words
We define ˆδ (q, ) = q and
ˆδ (q, xa) = δ(ˆδ (q, x), a)
Theorem: We have q.x = ˆδ(q, x) = ˆδ (q, x) for all x
21
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) = ˆδ (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 = ˆδ (q, x)
22
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
23
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)
24
Automatic Theorem Proving
A more complex example
f(0) = 0 f(1) = 1 f(n+2) = f(n)+f(n+1)−f(n)f(n+1)
f(2) = 1 f(3) = 0 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) −→ (b, c, b + c − bc) with the
initial state (0, 1, 1)
25
Product of automata
How do we represent interaction between machines?
This is via the product operation
There are different kind of products
We may then have combinatorial explosion: the product of n
automata with 2 states has 2n
states!
26
Product of automata (example)
The product of A
p0
p1 B
p0
p1 and
C
p1
p0 D
p1
p0 is A, C
p0
p1
B, C
p0
p1
A, D
p0
p1
B, D
p0
p1
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 p0s and odd number of
p1s
27
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
28
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
29
The Product Construction
Given A1 = (Q1, Σ, δ1, q1, F1) and A2 = (Q2, Σ, δ2, q2, F2) two DFAs
with the same alphabet Σ we can define the product A = A1 × A2
set of state Q = Q1 × Q2
transition function (r1, r2).a = (r1.a, r2.a)
intial state q0 = (q1, q2)
accepting states F = F1 × F2
30
The Product Construction
Lemma: (r1, r2).x = (r1.x, r2.x)
We prove this by induction
BASE: the statement holds for x =
STEP: if the statement holds for y it holds for x = ya
31
The Product Construction
Theorem: L(A1 × A2) = L(A1) ∩ L(A2)
Proof: We have (q1, q2).x = (q1.x, q2.x) in F iff q1.x ∈ F1 and
q2.x ∈ F2, that is x ∈ L(A1) and x ∈ L(A2)
Example: let Mk be the “cyclic” automaton that recognizes
multiple of k, such that L(Mk) = {an
| k divides n}, then
M6 × M9 M18
Notice that 6 divides k and 9 divides k iff 18 divides k
32
Product of automata
It can be quite difficult 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
33
Variation on the product
We define A1 ⊕ A2 as A1 × A2 but we change the notion of
accepting state
(r1, r2) accepting iff r1 ∈ F1 or r2 ∈ F2
Theorem: If A1 and A2 are DFAs, then
L(A1 ⊕ A2) = L(A1) ∪ L(A2)
Example: multiples of 3 or of 5 by taking M3 ⊕ M5
34
Complement
If A = (Q, Σ, δ, q0, F) we define the complement ¯A of A as the
automaton
¯A = (Q, Σ, δ, q0, Q − F)
Theorem: If A is a DFA, then L( ¯A) = Σ∗
− L(A)
Remark: We have A ⊕ A = A × A
35
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 iff there exists a DFA
A, on the same alphabet Σ such that L = L(A)
Theorem: If L1, L2 are regular then so are
L1 ∩ L2, L1 ∪ L2, Σ∗
− L1
36
Remark: Accessible Part of a DFA
Consider the following DFA
q0
1
0
q1
0
1 q2
0
0
q3
0
1
it is clear that it accepts the same language as the DFA
q0
1
0
q1
0
1
which is the accessible part of the DFA
The remaining states are not accessible from the start state and
can be removed
37
Remark: Accessible Part of a DFA
The set
Acc = {q0.x | x ∈ Σ∗
}
is the set of accessible states of the DFA (states that are accessible
from the state q0)
38
Remark: Accessible Part of a DFA
Proposition: If A = (Q, Σ, δ, q0, F) is a DFA then and
A = (Q ∩ Acc, Σ, δ, q0, F ∩ Acc) is a DFA such that L(A) = L(A ).
Proof: It is clear that A is well defined and that L(A ) ⊆ L(A).
If x ∈ L(A) then we have q0.x ∈ F and also q0.x ∈ Acc. Hence
q0.x ∈ F ∩ Acc and x ∈ L(A ).
39
Automatic Theorem Proving
Take Σ = {a, b}.
Define L set of x ∈ Σ∗
such that any a in x is followed by a b
Define L set of x ∈ Σ∗
such that any b in x is followed by a a
Then L ∩ L = { }
Intuitively if x = in L we have
. . . a . . . → . . . a . . . b . . .
if x in L we have
. . . b . . . → . . . b . . . a . . .
40
Automatic Theorem Proving
We should have L ∩ L = { } since a nonempty word in L ∩ L
should be infinite
We can prove this automatically with automata!
L is regular: write a DFA A for L
L is regular: write a DFA A for L
We can then compute A × A and check that
L ∩ L = L(A × A ) = { }
41
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,
offA, onB, offB
Between onA, on2 there should be at least one offA
The automaton expressing this condition is
p0
onB onA
=onA,onB
p1
offA
onB
=onB,offA
p3
offB
onA
p2
42
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
q0
onA
=onA,onB
onB
q1
q2
We can take the product of the two automata to express the two
conditions as one automaton, which may represent the control
system
43

Más contenido relacionado

La actualidad más candente

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 SetDhaval Shukla
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivativesmath265
 
An algorithm for computing resultant polytopes
An algorithm for computing resultant polytopesAn algorithm for computing resultant polytopes
An algorithm for computing resultant polytopesVissarion Fisikopoulos
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Traian Rebedea
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabRavi Jindal
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential slides
 
Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dagKiran K
 
2.2 limits ii
2.2 limits ii2.2 limits ii
2.2 limits iimath265
 
Limits and continuity[1]
Limits and continuity[1]Limits and continuity[1]
Limits and continuity[1]indu thakur
 
Linear transformations and matrices
Linear transformations and matricesLinear transformations and matrices
Linear transformations and matricesEasyStudy3
 
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 AlgorithmKiran K
 
Integration presentation
Integration presentationIntegration presentation
Integration presentationUrmila Bhardwaj
 

La actualidad más candente (20)

METHOD OF JACOBI
METHOD OF JACOBIMETHOD OF JACOBI
METHOD OF JACOBI
 
Dfa
DfaDfa
Dfa
 
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
 
Cse41
Cse41Cse41
Cse41
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivatives
 
An algorithm for computing resultant polytopes
An algorithm for computing resultant polytopesAn algorithm for computing resultant polytopes
An algorithm for computing resultant polytopes
 
Vector spaces
Vector spacesVector spaces
Vector spaces
 
Lec3
Lec3Lec3
Lec3
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
 
Fourier series 2
Fourier series 2Fourier series 2
Fourier series 2
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential
 
Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dag
 
2.2 limits ii
2.2 limits ii2.2 limits ii
2.2 limits ii
 
Limits and continuity[1]
Limits and continuity[1]Limits and continuity[1]
Limits and continuity[1]
 
Functions (Theory)
Functions (Theory)Functions (Theory)
Functions (Theory)
 
Linear transformations and matrices
Linear transformations and matricesLinear transformations and matrices
Linear transformations and matrices
 
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
 
Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)
 
Integration presentation
Integration presentationIntegration presentation
Integration presentation
 

Destacado

Odluka nvo 2013.
Odluka nvo 2013.Odluka nvo 2013.
Odluka nvo 2013.Nazif Veliq
 
ConductingOnlineSurveys_Sue_ch1
ConductingOnlineSurveys_Sue_ch1ConductingOnlineSurveys_Sue_ch1
ConductingOnlineSurveys_Sue_ch1Valerie Sue
 
Internet y Navegador Web
Internet y Navegador WebInternet y Navegador Web
Internet y Navegador WebValeria Arias
 
Synonyms ETAI2012
Synonyms ETAI2012Synonyms ETAI2012
Synonyms ETAI2012Leo Selivan
 
Team 546 Final oap report
Team 546 Final oap reportTeam 546 Final oap report
Team 546 Final oap reportmiket64
 
Rock werchter hidde de bleeker en jeroen deconinck
Rock werchter   hidde de bleeker en jeroen deconinckRock werchter   hidde de bleeker en jeroen deconinck
Rock werchter hidde de bleeker en jeroen deconinckjerslider
 
Unlimited Joy (Zephaniah 3.17) by Harry Zeiders
Unlimited Joy (Zephaniah 3.17) by Harry ZeidersUnlimited Joy (Zephaniah 3.17) by Harry Zeiders
Unlimited Joy (Zephaniah 3.17) by Harry ZeidersHarryKZeiders
 
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...SMART Infrastructure Facility
 
Video slides 2
Video slides 2Video slides 2
Video slides 2amchapaj
 
10 strategies-to-drive-your-competition-crazy-v1
10 strategies-to-drive-your-competition-crazy-v110 strategies-to-drive-your-competition-crazy-v1
10 strategies-to-drive-your-competition-crazy-v1Sourabh Rana
 
ネ申待ちカレンダー
ネ申待ちカレンダーネ申待ちカレンダー
ネ申待ちカレンダーDaichi Saito
 
Digital branding 2015. Особенности национального интернет шоппинга
Digital branding 2015. Особенности национального интернет шоппингаDigital branding 2015. Особенности национального интернет шоппинга
Digital branding 2015. Особенности национального интернет шоппингаАрмен Манукян
 

Destacado (20)

My culture
My cultureMy culture
My culture
 
7 keajaiban-rezeki
7 keajaiban-rezeki7 keajaiban-rezeki
7 keajaiban-rezeki
 
Odluka nvo 2013.
Odluka nvo 2013.Odluka nvo 2013.
Odluka nvo 2013.
 
Oracle fundamentals and sql
Oracle fundamentals and sqlOracle fundamentals and sql
Oracle fundamentals and sql
 
ConductingOnlineSurveys_Sue_ch1
ConductingOnlineSurveys_Sue_ch1ConductingOnlineSurveys_Sue_ch1
ConductingOnlineSurveys_Sue_ch1
 
Internet y Navegador Web
Internet y Navegador WebInternet y Navegador Web
Internet y Navegador Web
 
Synonyms ETAI2012
Synonyms ETAI2012Synonyms ETAI2012
Synonyms ETAI2012
 
2Q13 ISG Outsourcing Index
2Q13 ISG Outsourcing Index2Q13 ISG Outsourcing Index
2Q13 ISG Outsourcing Index
 
Team 546 Final oap report
Team 546 Final oap reportTeam 546 Final oap report
Team 546 Final oap report
 
Rock werchter hidde de bleeker en jeroen deconinck
Rock werchter   hidde de bleeker en jeroen deconinckRock werchter   hidde de bleeker en jeroen deconinck
Rock werchter hidde de bleeker en jeroen deconinck
 
Unlimited Joy (Zephaniah 3.17) by Harry Zeiders
Unlimited Joy (Zephaniah 3.17) by Harry ZeidersUnlimited Joy (Zephaniah 3.17) by Harry Zeiders
Unlimited Joy (Zephaniah 3.17) by Harry Zeiders
 
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...
SMART Seminar Series: "Ghorka 2015 earthquake: Impacts on resilience of commu...
 
Lesson 6
Lesson 6Lesson 6
Lesson 6
 
Art Over Art
Art Over ArtArt Over Art
Art Over Art
 
Video slides 2
Video slides 2Video slides 2
Video slides 2
 
10 strategies-to-drive-your-competition-crazy-v1
10 strategies-to-drive-your-competition-crazy-v110 strategies-to-drive-your-competition-crazy-v1
10 strategies-to-drive-your-competition-crazy-v1
 
ネ申待ちカレンダー
ネ申待ちカレンダーネ申待ちカレンダー
ネ申待ちカレンダー
 
Digital branding 2015. Особенности национального интернет шоппинга
Digital branding 2015. Особенности национального интернет шоппингаDigital branding 2015. Особенности национального интернет шоппинга
Digital branding 2015. Особенности национального интернет шоппинга
 
Sourcing Market Overview
Sourcing Market OverviewSourcing Market Overview
Sourcing Market Overview
 
9707 s14 qp_33
9707 s14 qp_339707 s14 qp_33
9707 s14 qp_33
 

Similar a Teori automata lengkap

6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdfshruti533256
 
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 1Srimatre K
 
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurMid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfdawod yimer
 
lecture 10 formal methods in software enginnering.pptx
lecture 10 formal methods in software enginnering.pptxlecture 10 formal methods in software enginnering.pptx
lecture 10 formal methods in software enginnering.pptxSohaibAlviWebster
 
Theoryofcomp science
Theoryofcomp scienceTheoryofcomp science
Theoryofcomp scienceRaghu nath
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introductionNAMRATA BORKAR
 
Theory of automata
Theory of automataTheory of automata
Theory of automataArslan905905
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...mathsjournal
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...mathsjournal
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...parmeet834
 
Minimum mean square error estimation and approximation of the Bayesian update
Minimum mean square error estimation and approximation of the Bayesian updateMinimum mean square error estimation and approximation of the Bayesian update
Minimum mean square error estimation and approximation of the Bayesian updateAlexander Litvinenko
 
Variations on the method of Coleman-Chabauty
Variations on the method of Coleman-ChabautyVariations on the method of Coleman-Chabauty
Variations on the method of Coleman-Chabautymmasdeu
 

Similar a Teori automata lengkap (20)

Dfa h11
Dfa h11Dfa h11
Dfa h11
 
Finite automata
Finite automataFinite automata
Finite automata
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
 
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
 
Microeconomics-Help-Experts.pptx
Microeconomics-Help-Experts.pptxMicroeconomics-Help-Experts.pptx
Microeconomics-Help-Experts.pptx
 
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurMid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
lecture 10 formal methods in software enginnering.pptx
lecture 10 formal methods in software enginnering.pptxlecture 10 formal methods in software enginnering.pptx
lecture 10 formal methods in software enginnering.pptx
 
Theoryofcomp science
Theoryofcomp scienceTheoryofcomp science
Theoryofcomp science
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
PDA (1) (1).pptx
PDA (1) (1).pptxPDA (1) (1).pptx
PDA (1) (1).pptx
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...
 
On Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum planeOn Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum plane
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 
Minimum mean square error estimation and approximation of the Bayesian update
Minimum mean square error estimation and approximation of the Bayesian updateMinimum mean square error estimation and approximation of the Bayesian update
Minimum mean square error estimation and approximation of the Bayesian update
 
Variations on the method of Coleman-Chabauty
Variations on the method of Coleman-ChabautyVariations on the method of Coleman-Chabauty
Variations on the method of Coleman-Chabauty
 

Más de Muhammad Love Kian (20)

LEASING FACTORING MODAL VENTURA
LEASING FACTORING MODAL VENTURALEASING FACTORING MODAL VENTURA
LEASING FACTORING MODAL VENTURA
 
Prototyping model bahasa indonesia
Prototyping model bahasa indonesiaPrototyping model bahasa indonesia
Prototyping model bahasa indonesia
 
Sistem informasi computer
Sistem informasi computerSistem informasi computer
Sistem informasi computer
 
Deteksi dan koreksi kesalahan lengkap
Deteksi dan koreksi kesalahan lengkapDeteksi dan koreksi kesalahan lengkap
Deteksi dan koreksi kesalahan lengkap
 
Sistem operasi input output
Sistem operasi input outputSistem operasi input output
Sistem operasi input output
 
Skripsi cahyaningrum bali
Skripsi cahyaningrum baliSkripsi cahyaningrum bali
Skripsi cahyaningrum bali
 
Khusyu itu-mudah abu sangkan
Khusyu itu-mudah abu sangkanKhusyu itu-mudah abu sangkan
Khusyu itu-mudah abu sangkan
 
Desain kantor
Desain kantorDesain kantor
Desain kantor
 
Data pendukung rab
Data pendukung rabData pendukung rab
Data pendukung rab
 
Aan
AanAan
Aan
 
Tugas soal uas decision making
Tugas soal uas decision makingTugas soal uas decision making
Tugas soal uas decision making
 
Skripsi cahyaningrum
Skripsi cahyaningrumSkripsi cahyaningrum
Skripsi cahyaningrum
 
Artikel financial-distress-arus-kas-multinomial
Artikel financial-distress-arus-kas-multinomialArtikel financial-distress-arus-kas-multinomial
Artikel financial-distress-arus-kas-multinomial
 
Cara memikat wanita_idaman_anda
Cara memikat wanita_idaman_andaCara memikat wanita_idaman_anda
Cara memikat wanita_idaman_anda
 
Doa untuk-perniagaan
Doa untuk-perniagaanDoa untuk-perniagaan
Doa untuk-perniagaan
 
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
 
Cara belajar orang_sukses
Cara belajar orang_suksesCara belajar orang_sukses
Cara belajar orang_sukses
 
Maktabah syamilah manual
Maktabah syamilah manualMaktabah syamilah manual
Maktabah syamilah manual
 
Skripsi lengkap
Skripsi lengkapSkripsi lengkap
Skripsi lengkap
 
Bisnisgooonline booklet
Bisnisgooonline bookletBisnisgooonline booklet
Bisnisgooonline booklet
 

Último

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Último (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Teori automata lengkap

  • 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 q0 ∈ Q and F ⊆ Q 1
  • 2. Deterministic Finite Automata So a DFA is mathematically represented as a 5-uple (Q, Σ, δ, q0, F) The transition function δ is a function in Q × Σ → Q Q × Σ is the set of 2-tuples (q, a) with q ∈ Q and a ∈ Σ 2
  • 3. Deterministic Finite Automata How to present a DFA? With a transition table 0 1 →q0 q2 q0 ∗q1 q1 q1 q2 q2 q1 The → indicates the start state: here q0 The ∗ indicates the final state(s) (here only one final state q1) This defines the following transition diagram q0 0 1 q2 1 0 q1 0,1 3
  • 4. Deterministic Finite Automata For this example Q = {q0, q1, q2} start state q0 F = {q1} Σ = {0, 1} δ is a function from Q × Σ to Q δ : Q × Σ → Q δ(q0, 1) = q0 δ(q0, 0) = q2 4
  • 5. Example: password When does the automaton accepts a word?? It reads the word and accepts it if it stops in an accepting state q0 t =t q1 h =h q2 e =e q3 n =n q4 q5 Only the word then is accepted Here Q = {q0, q1, q2, q3, q4} Σ is the set of all characters F = {q4} We have a “stop” or “dead” state q5, not accepting 5
  • 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) 6
  • 7. We get the following automaton A 1 0 B 1 0 C 1 0 D 0,1 Transition table 0 1 →A C B B C B C C D ∗D D D Q = {A,B,C,D}, Σ = {0,1}, start state A, final state(s) {D} 7
  • 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) 8
  • 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, Σ, δ, q0, F L = {x ∈ Σ∗ | q0.x ∈ F} On the previous example 100 is not accepted and 10101 is accepted 9
  • 10. Minimalisation The same language may be represented by different DFA A 1 0 B 1 0 C 1 0 D 0,1 and A 1 0 B 1 0 C 0,1 10
  • 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 11
  • 12. Example Mn the “cyclic” automaton with n states on Σ = {1} such that L(Mn) = {1l | n divides l} 12
  • 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), run (q, []) = q accept x = final (run (A, x)) where final A = final B = False, final C = True 13
  • 14. Functional representation: Version 2 E = 0|1, W = [E] Three functions FA, FB, FC : W → Bool FA (1 : x) = FA x, FA (0 : x) = FB x, FA [] = False FB (1 : x) = FC x, FB (0 : x) = FB x, FB [] = False FC (1 : x) = FC x, FC (0 : x) = FC x, FC [] = True We have a mutual recursive definition of 3 functions 14
  • 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 15
  • 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 16
  • 17. Functional representation: Version 4 We have Q -> E -> Q ~ Q x E -> Q ~ E -> (Q -> Q) 17
  • 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 18
  • 19. Functional representation: Version 4 -- run q [b1,...,bn] is -- next bn (next b(n-1) (... (next b1 q)...)) -- run = foldl next 19
  • 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 .(zy) = (q .z).y for all q 20
  • 21. The other definition of ˆδ Recall that a(b(cd)) = ((ab)c)d; we have two descriptions of words We define ˆδ (q, ) = q and ˆδ (q, xa) = δ(ˆδ (q, x), a) Theorem: We have q.x = ˆδ(q, x) = ˆδ (q, x) for all x 21
  • 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) = ˆδ (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 = ˆδ (q, x) 22
  • 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 23
  • 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) 24
  • 25. Automatic Theorem Proving A more complex example f(0) = 0 f(1) = 1 f(n+2) = f(n)+f(n+1)−f(n)f(n+1) f(2) = 1 f(3) = 0 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) −→ (b, c, b + c − bc) with the initial state (0, 1, 1) 25
  • 26. Product of automata How do we represent interaction between machines? This is via the product operation There are different kind of products We may then have combinatorial explosion: the product of n automata with 2 states has 2n states! 26
  • 27. Product of automata (example) The product of A p0 p1 B p0 p1 and C p1 p0 D p1 p0 is A, C p0 p1 B, C p0 p1 A, D p0 p1 B, D p0 p1 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 p0s and odd number of p1s 27
  • 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 28
  • 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 29
  • 30. The Product Construction Given A1 = (Q1, Σ, δ1, q1, F1) and A2 = (Q2, Σ, δ2, q2, F2) two DFAs with the same alphabet Σ we can define the product A = A1 × A2 set of state Q = Q1 × Q2 transition function (r1, r2).a = (r1.a, r2.a) intial state q0 = (q1, q2) accepting states F = F1 × F2 30
  • 31. The Product Construction Lemma: (r1, r2).x = (r1.x, r2.x) We prove this by induction BASE: the statement holds for x = STEP: if the statement holds for y it holds for x = ya 31
  • 32. The Product Construction Theorem: L(A1 × A2) = L(A1) ∩ L(A2) Proof: We have (q1, q2).x = (q1.x, q2.x) in F iff q1.x ∈ F1 and q2.x ∈ F2, that is x ∈ L(A1) and x ∈ L(A2) Example: let Mk be the “cyclic” automaton that recognizes multiple of k, such that L(Mk) = {an | k divides n}, then M6 × M9 M18 Notice that 6 divides k and 9 divides k iff 18 divides k 32
  • 33. Product of automata It can be quite difficult 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 33
  • 34. Variation on the product We define A1 ⊕ A2 as A1 × A2 but we change the notion of accepting state (r1, r2) accepting iff r1 ∈ F1 or r2 ∈ F2 Theorem: If A1 and A2 are DFAs, then L(A1 ⊕ A2) = L(A1) ∪ L(A2) Example: multiples of 3 or of 5 by taking M3 ⊕ M5 34
  • 35. Complement If A = (Q, Σ, δ, q0, F) we define the complement ¯A of A as the automaton ¯A = (Q, Σ, δ, q0, Q − F) Theorem: If A is a DFA, then L( ¯A) = Σ∗ − L(A) Remark: We have A ⊕ A = A × A 35
  • 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 iff there exists a DFA A, on the same alphabet Σ such that L = L(A) Theorem: If L1, L2 are regular then so are L1 ∩ L2, L1 ∪ L2, Σ∗ − L1 36
  • 37. Remark: Accessible Part of a DFA Consider the following DFA q0 1 0 q1 0 1 q2 0 0 q3 0 1 it is clear that it accepts the same language as the DFA q0 1 0 q1 0 1 which is the accessible part of the DFA The remaining states are not accessible from the start state and can be removed 37
  • 38. Remark: Accessible Part of a DFA The set Acc = {q0.x | x ∈ Σ∗ } is the set of accessible states of the DFA (states that are accessible from the state q0) 38
  • 39. Remark: Accessible Part of a DFA Proposition: If A = (Q, Σ, δ, q0, F) is a DFA then and A = (Q ∩ Acc, Σ, δ, q0, F ∩ Acc) is a DFA such that L(A) = L(A ). Proof: It is clear that A is well defined and that L(A ) ⊆ L(A). If x ∈ L(A) then we have q0.x ∈ F and also q0.x ∈ Acc. Hence q0.x ∈ F ∩ Acc and x ∈ L(A ). 39
  • 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 set of x ∈ Σ∗ such that any b in x is followed by a a Then L ∩ L = { } Intuitively if x = in L we have . . . a . . . → . . . a . . . b . . . if x in L we have . . . b . . . → . . . b . . . a . . . 40
  • 41. Automatic Theorem Proving We should have L ∩ L = { } since a nonempty word in L ∩ L should be infinite We can prove this automatically with automata! L is regular: write a DFA A for L L is regular: write a DFA A for L We can then compute A × A and check that L ∩ L = L(A × A ) = { } 41
  • 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, offA, onB, offB Between onA, on2 there should be at least one offA The automaton expressing this condition is p0 onB onA =onA,onB p1 offA onB =onB,offA p3 offB onA p2 42
  • 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 q0 onA =onA,onB onB q1 q2 We can take the product of the two automata to express the two conditions as one automaton, which may represent the control system 43