I agree with Mr Anonymous above. Given any NFA M =(Q,L,d,q0,F) where Q is the states q0...qn and L is the Language eg 0, 1, 3 and d is the change table eg q0,"0"->q1 q0 is the start state F are the goal states. you can get a DFA M' = (Q',L,d',q0',F') by forming Q' as the set of all subsets of the Q That, depending on the size of your Q, will be big... The monk has a very interesting answer. You basically have to do this traversal in generating the d'. Combining the traversal and the state generating would be interesting. This traversal follows the map of the resulting DFA so you could concievably combine the steps. All you would need is a table of pointers to the q' states so if you generate a q' composite state [qx.. qy... qz] that has already been traversed, you link to the existing q' state. So you basically build the DFA's nodes as you go. This would save greatly on memory use of a complicated NFA.
---
Crulx
crulx@iaxs.net

In reply to Re: NFA to DFA program by Crulx
in thread NFA to DFA program by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.