7164901 Arden s Theorem Tafl

18
Presentation on : Presentation on : Presented by:- Presented by:- Gaurav Gupta Gaurav Gupta 20/05 20/05 IInd B.Tech IInd B.Tech I.T. I.T. ARDEN’S THEOREM” ARDEN’S THEOREM”

description

Ardens theorem

Transcript of 7164901 Arden s Theorem Tafl

  • Presentation on :Presented by:- Gaurav Gupta 20/05 IInd B.Tech I.T.

    ARDENS THEOREM

  • CONSRTRUCTION OF REGULAR EXPRESSION FROM DFAThe 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.ARDENS THEOREM is one means to implement it.

  • ARDENS THEOREMLet P and Q be two regular expression over alphabet . If P does not contain NULL STRING (), then :R = Q + RP

    Has a unique solution that is :R = QP*

    Now lets have a look at its mathematical proof

  • MATHEMATICAL PROOFIt can be understood as :R = Q + RPPut the value of R in R.H.S.R = Q + (Q + RP) P= Q +QP + RP2 When we put the value of R again and again we get the following equation: R = Q + QP + QP2 + QP3 R = Q ( 1 + P + P2 + P3 ) R = Q ( + P + P2 + P3 ) R = QP* -(By the definition of closure operation for regular expression.)

  • IMPLEMENTATION :USE OF ARDENS THEOREM TO FIND REGULAR EXPRESSION OF A DFA : There are certain assumptions which are made regarding the transition system : The transition diagram should not have -transition. It must have only a single initial state. Its vertices are q1 , q2 , , qn . qi is the final state....contd.

  • Contd wij denotes the regular expression representing the set of labels of edges from qi to qj .We can get the following set of equation in q1 qn .q1 = q1 w11 + q2 w21 + + qn wn1 + (since q1 is the initial state)q2 = q2 w12 + q2 w22 + + qn wn2::qn = q1 w1n + q2 w2n + + qn wnn We solve these equations for qi in terms wijs and it will be the required expression.

  • EXAMPLE # 1 :QUES: Find the regular expression for transition diagram given below :

    q1q2q3q4abababa,b

  • SOLUTION # 1 :q1q2q3q4ababbaa,bForm the eqns.

    q1 = q2 b + q3 a + -eqn(i)

  • SOLUTION # 1 :Form the eqns. q1 = q2 b + q3 a + -eqn(i)q2 = q1 a -eqn(ii)

    q1q2q3q4abababa,b

  • SOLUTION # 1 :Form the eqns.q1 = q2 b + q3 a + -eqn(i)q2 = q1 a -eqn(ii)

    q3 = q1 b -eqn(iii)

    q1q2q3q4ababab

  • SOLUTION # 1 :Form the eqns. q1 = q2 b + q3 a + -(i)q2 = q1 a (ii)q3 = q1 b (iii)

    q4 = q2 a + q3 b + q4 a + q4 b-eqn(iv)q1q2q3q4abababa,b

  • SOLUTION # 1 :Form the eqns. q1 = q2 b + q3 a + (i)q2 = q1 a (ii)q3 = q1 b (iii)q4 = q2 a + q3 b + q4 a + q4 b (iv)Put q2 and q3 in q1 as :q1 = q1 ab + q1 ba + q1 = + q1 (ab + ba)q1 = (ab + ba)*

    q1q2q3q4abababa,bSo required regular expression is : (ab + ba)*

  • EXAMPLE # 2 :QUES: Construct a regular expressioncorresponding to the state diagram:

    q1q2q3011001

  • SOLUTION # 2 :Form the eqns.q1 = q1 0 + q3 0 + -(i)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)q2 = q1 1(1 + 01)*So, q1 = q1 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)*

    q1q2q3011001So required regular expression is : (0 + 1(1 + 01)*00)*

  • EXAMPLE # 3 :q4q2q1q31010001QUES : Find the regular expression corresponding to:1

  • SOLUTION # 3 :Form the eqns.q1 = q1 0 + q3 0 + q4 0 + q2 = q1 1 + q2 1 + q4 1q3 = q2 0q4 = q3 1Now q4 = q3 1 = q2 01Using q2 equation, we get :q2 = q1 1 + q2 1 + q2 011 = q1 1 + q2(1+011) = q1 1(1 + 011)* = q1 (1(1 + 011)*)q4q2q1q310100011contd.

  • 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)

  • Prof. Vinay Pathak H.O. C.S.E. DepartmentH.B.T.I. Kanpur.Special Thanks to :