Suject :- Computer Science Course Nme :- Theory Of Computtion DA TO REGULAR EXPRESSIONS Report Sumitted y:- Ajy Singh Meen 07000505 jysmeen@cse.iit.c.in
BASIC DEINITIONS DA:- A finite stte mchine where for ech pir of stte nd input symol there is one nd only one trnsition to next stte. DAs recognize the set of regulr lnguges nd no other lnguges. Regulr Expressions:- Regulr expressions consist of constnts nd opertors tht denote sets of strings nd opertions over these sets, respectively. A regulr expression represents "pttern" strings tht mtch the pttern re in the lnguge, strings tht do not mtch the pttern re not in the lnguge. All strings contining exctly one on = {0, } *. 0 0 Strting Sttet Regulr Expressions for this lnguge over is :- 0 * 0 * Non-inl Stte inl Stte
AIM & PROCEDURE The im of this nimtion is to clrify the concepts of DA to Regulr Expressions y illustrting some exmples. In this nimtion we will explin this topic y first giving its rief introduction through its definition nd then some nottions of Automt Theory. In this nimtion we will hve two exmples for explining this topic. In the first exmple we will ply with less numer of sttes simply displying i circles for the sttes t nd lines connecting them nd then ccording to the lgorithm we will convert tht DA into regulr expression. In the second exmple we will hndle with more numer of sttes. And do the required nimtion like first exmple. The nimtion will show the construction of simple sttes reducing digrms nd chnge in their trnsction nd strings over the trnsction hppening. And inlly we will get our Regulr Expression for the given DA.
Prolem Sttementt t Input:- A figure with given numer of non-finl sttes nd finl sttes. Output:- A regulr expression for the given DA. Regulr Expression contining comintions of some finite symols over.
Prolem :- Input :-Lnguge over ={0,} *,such tht every string is multiple of 3 in inry. Output:- A Regulr Expression representing the ove DA. Solution:- DA representing the ove prolem:- Where 0,,2 02in circles 0 represents the 0 reminders. 0 2 0 Step :- Add new initil stte (S) nd new finl stte () with - trnsition:- New-Strting 0 Stte S 0 0 2 New-inl Stte 0
Step 2:- Remove the circle with reminder 2. 0 Now circles with 0, doesn t represent S 0 0 * 0 reminders here. inl Step:- After Removing ll the circles with 0,. S Strting Stte (0 + (0 * 0)) * inl Stte So, the finl Regulr Expression for the ove DA is :- * * (0 + (0 * 0)) *
Prolem 2:- Input :-Lnguge over ={,} *,such tht every string strts nd ends with the sme symol. Output:- A Regulr Expression representing the ove DA. Solution:- DA representing the ove prolem:- Strting Stte q0 q2 q q3 q4
Step :- Add new initil stte (S) nd new finl stte () with - trnsition:- q q3 S q0 Strting q2 q4 Stte Step 2:- Remove the circle nmed s q3 nd q4. S Strting Stte q0 q ( + * ) * ( ) ( + * ) * q2 ( )
Step 3:- Remove the circle nmed s q0. Strting ti Stte S q ( + * ) * q2 ( + * ) * inl Step:- After Removing ll the circles nmed s q,q2. S [ + ( + * ) * + ( + * ) * ] So, the finl Regulr Expression for the ove DA is :- * * * * [ + ( + * ) * + ( + * ) * ]
urther Interctivity ti it We will rrnge more nd more questions for the user y which he or she cn do some questions sed on this topic. or this nimtion user input is very-very hrd so I m voiding it. We will show the formtion of reduced digrms/figure ccording to the lgorithm in the nimtion. We will show how the lgorithm works in the nimtion prt nd how the no of sttes chnges when they re removed or dded in the nimtion.
Review Questions Output is the DA listed s regulr expressions. (ns:- miniml) A DA represents finite stte mchine tht recognizes. (ns:- Regulr Expression) Wht is the regulr expression for the given DA of lnguge contining even numer of :- q0 q. -----------------------------------------[ns :- ( + * ) * ] Regulr Expression for this DA is :- q0 q q2.-----------------------------[ns:- (() * )]
urther Reding Links http://www.cs.geneseo.edu/~ldwin/csci342/fll2006/099df2re.html http://www.cs.uiuc.edu/clss/f05/cs475/lectures/new/lec05.pdf http://www.mec.c.in/resources/notes/notes/utomt/trnsforming%20s A%20into%20RE.htm http://en.wikipedi.org/wiki/deterministic_finite stte_mchine http://en.wikipedi.org/wiki/regulr_expressions expressions
CREDITS