1 / 11

Reducing DFA’s

Reducing DFA’s. Section 2.4. Reduction of DFA. For any language, there are many DFA’s that accept the language Why would we want to find the smallest? Algorithm: Finds smallest equivalent DFA. Distinguishable States.

chana
Download Presentation

Reducing DFA’s

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reducing DFA’s Section 2.4

  2. Reduction of DFA • For any language, there are many DFA’s that accept the language • Why would we want to find the smallest? • Algorithm: Finds smallest equivalent DFA

  3. Distinguishable States • A state p is indistinguishable from another q if, for all walks w, δ*(p,w)  F implies δ*(q,w)  F and δ*(p,w)  F implies δ*(q,w)  F • Otherwise, they are distinguishable

  4. Two Step Algorithm • First, mark all pairs of states as distinguishable or indistinguishable • Then, merge indistinguishable states into one state for the smaller graph

  5. Mark Algorithm • Remove inaccessible states • Mark all states in F as distinguishable from those not in F. • Repeat until all pairs are marked: For all pairs (p,q) and all symbols (a), if δ(p,a) is distinguishable from δ(q,a), then p is distinguishable from q.

  6. Reduce Algorithm • Create a state for each set of indistinguishable states from the Mark algorithm. • Rewrite transitions between states. If δ(p,a) = q, then make a transition from the node containing the original p to the node containing the original q and label it a.

  7. Example q1 1 0 0 0 1 q4 q0 q2 0,1 0 1 1 q3

  8. Example Distinguishable Pairs Final –Nonfinal states (q0,q4) (q1,q4) (q2,q4) (q3,q4)

  9. Example Distinguishable Pairs: Chart Compare (q0,q4) (q1,q4) (q2,q4) (q3,q4) (q0,q1) (q0,q2) (q0,q3)

  10. Example Distinguishable Pairs: (q0,q4) (q1,q4) (q2,q4) (q3,q4) (q0,q1) (q0,q2) (q0,q3) Indistinguishable Pairs: {q0} {q1, q2,q3} {q4}

  11. q1 1 0 0 0 1 q4 q0 q2 0,1 0 1 1 q3 Example 0 0,1 0,1 1 0 1,2,3 4

More Related