Is there a program that creates DFA from expression

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Sep 2004
Posts: 2
Reputation: Neco_Coneco is an unknown quantity at this point 
Solved Threads: 0
Neco_Coneco Neco_Coneco is offline Offline
Newbie Poster

Is there a program that creates DFA from expression

 
0
  #1
Sep 28th, 2004
Like if I enter ab* it will draw a state diagram I know they have ones that convert nfa to dfa but I have yet to find one that will draw from an expression. Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 1
Reputation: bunty is an unknown quantity at this point 
Solved Threads: 0
bunty bunty is offline Offline
Newbie Poster

Re: Is there a program that creates DFA from expression

 
0
  #2
Oct 4th, 2004
hey buddy i cannot solve yr problem but may be u can solve mine
i need a cog\de that can conver a regular expresion to NFA and then to DFA
andthen compare the 2 regular expressions to find out if they are equal.
please do reply in either case if u wish to help me or not .
thank u
nilay007@rediffmail.com





Originally Posted by Neco_Coneco
Like if I enter ab* it will draw a state diagram I know they have ones that convert nfa to dfa but I have yet to find one that will draw from an expression. Thanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 2
Reputation: Neco_Coneco is an unknown quantity at this point 
Solved Threads: 0
Neco_Coneco Neco_Coneco is offline Offline
Newbie Poster

Re: Is there a program that creates DFA from expression

 
0
  #3
Oct 5th, 2004
Sorry I don't know.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 18
Reputation: Nuez_Jr is an unknown quantity at this point 
Solved Threads: 1
Nuez_Jr's Avatar
Nuez_Jr Nuez_Jr is offline Offline
Newbie Poster

Re: Is there a program that creates DFA from expression

 
0
  #4
Oct 6th, 2004
For obvious reasons I can't recite code from memory that'll do what you're asking for, but there does exist a regexp-->DFA algorithm...on paper. You're probably already familiar with it, it's the one where you create a start edge labelled with the original expression, and then perform a sequence of splits/branches/loops based on the operators in the expression.

That can be done in code just as easily (if not easier) - but you'll have to represent the DFA as a table. Specifically, a list of edges. Take the starting edge (labelled with the original expression) and apply a transformation according to the highest-precedence operator in the expression. Then recurse onto the resulting edge(s) and do the same for their labels.

I recommend doing it in Scheme ; )

The main function might look like
(elaborate-DFA edge next-newstate),
where edge is a representation of a transition in the graph of the form
(origin destination label).
...


Of course, if you just want a nifty little app that'll draw pretty pictures for you, I believe there's one called Deus Ex Machina. Google may have something to say about that.
Last edited by Nuez_Jr; Oct 6th, 2004 at 6:27 am. Reason: addon
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC