Arden's Theorem (Tafl)
Arden's Theorem (Tafl)
Arden's Theorem (Tafl)
“ARDEN’S
THEOREM”
Presented by:-
Gaurav Gupta
20/05
IInd B.Tech I.T.
CONSRTRUCTION OF
REGULAR EXPRESSION
FROM DFA
The regular expression is mathematical
expression for a given regular language.
We know that for every regular language there
exist a DFA.
We can conclude that for regular expression,
regular language for that regular expression
and DFA for that regular language are similar
things in different representation.
So we can construct regular expression for
every Deterministic Automata.
ARDEN’S THEOREM is one means to implement
it.
AR DEN’S TH EO REM
Let P and Q be two regular expression
over alphabet Σ. If P does not contain
NULL STRING (ε), then :
R = Q + RP
a b a
b
q3 q4 a,b
SOLUTION # 1 :
a
Form the eqns.
q1 q2
b
q1 = q2 b + q3 a + b a a
ε
-eqn(i) b
q3 q4
a,b
SOLUTION # 1 :
a
Form the eqns.
q1 q2
q1 = q2 b + q3 a + b
ε a b a
-eqn(i)
q2 = q1 a q3
b
q4
-eqn(ii)
a,b
SOLUTION # 1 :
a
Form the eqns.
q1 q2
q1 = q2 b + q3 a + b
ε a b a
b
q3 q4
-eqn(i)
q2 = q1 a -eqn
(ii)
SOLUTION # 1 :
q1 q2
q1 = q2 b + q3 a + ε -
(i) b
q2 = q1 a – a b
(ii) a
q3 = q1 b –
(iii) b
q3 q4
q4 = q2 a + q3 b + a,b
q4 a + q4 b
-eqn(iv)
SOLUTION # 1 :
Form the eqns. a
q1 = q2 b + q3 a + ε –(i) q1 q2
q2 = q1 a –(ii)
b
q3 = q1 b –(iii)
q4 = q2 a + q3 b + q4 a a b
+ q4 b a
–(iv)
Put q2 and q3 in q1 as : b
q3 q4
q1 = q1 ab + q1 ba + ε
q1 = ε + q1 (ab + ba)
a,b
q1 = ε (ab + ba)*
So required regular expression is : (ab +
ba)*
EXAMPLE # 2 :
0 1 q2 1
q3 0
SOLUTION # 2 :
0
Form the eqns.
q1 = q1 0 + q3 0 + ε -(i) q1 1
q2 = q1 1 + q2 1 + q3 1 -(ii)
q3 = q2 0 –(iii)
q2 = q1 1 + q2 1 + (q2 0)1
= q1 1 + q2(1 + 01) 0 1 q2
1
q2 = q1 1(1 + 01)*
So, q1 = q1 0 + q3 0 + ε
q3 0
= q1 0 + q2 00 + ε
= q1 0 + (q1 1(1 + 01)*00)
+ε
= q1(0 + 1(1 + 01)*00) + ε
= ε(0 + 1(1 + 01)*00)*
So required regular expression is :
(0 + 1(1 + 01)*00)*
EXAMPLE # 3 :
QUES : Find the regular expression
corresponding to: 0 1
q1 q2
1
0
0
0
1
q4 q3
1
SOLUTION # 3 :
Form the eqns. 0 1
q1 = q1 0 + q3 0 + q4 0 +
ε q1 q2
q2 = q1 1 + q2 1 + q4 1 1
q3 = q2 0
q4 = q3 1 0
0
Now q4 = q3 1 = q2 01 0
Using q2 equation, we get
: 1
q4 q3
q2 = q1 1 + q2 1 + q2 011
= q1 1 + q2(1+011) 1
= q1 1(1 + 011)*
= q1 (1(1 + 011)*) …contd.
SOLN # 3 : (contd…)
Put q3 and q4 in q1 eqn.
q1 = q1 0 + q2 00 + q2 010 + ε
= q1 0 + q2 (00 + 010) + ε
= q1 0 + q1 1(1 + 011)* (00 + 010)*
= ε (0 + 1(1 + 011)* (00 + 010))*
Put q2 in q4 eqn.
q4 = q1 1(1 + 011)* 01
= q1 (1(1 + 01)* 01)
= (0+1(1 + 011)* ( 00 + 010))* ( 1(1 + 011)*
01)
So the required regular expression is :
(0+1(1 + 011)* ( 00 + 010))* ( 1(1 + 011)* 01)
Special Thanks
to :
Prof. Vinay Pathak
H.O. C.S.E. Department
H.B.T.I. Kanpur.