Presentation is loading. Please wait.

Presentation is loading. Please wait.

Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these.

Similar presentations


Presentation on theme: "Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these."— Presentation transcript:

1 Regular Language Algorithms

2 Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these computational systems as data that can be manipulated. It is worthwhile trying to catalog these algorithms.

3 Trivial algorithms The following algorithms are trivial – DFA to NFA – NFA to  -NFA – NFA to GenNFA A DFA is a quintuple D=(Q, ,s,F,  )  Q   Q An NFA is a quintuple N=(Q, ,s,F,T)  Q   Set(Q) A  -NFA is a quintuple L=(Q, ,s,F,  )  Q  (  Set(Q) GenNFA is a quintuple A=(Q, ,s,F,  )  Q  Q  RegExp(  Q is a set of states S is a set of characters (the alphabet) S Is a State called the start state F is a set of states called the final states

4 Closure Algorithms over DFAs Reversal – Reverse arrows – Start becomes final, final becomes start Complement – Swap the status of final and non-final states Union – Product construction – Any pair with at least one final state is final Intersection – Product construction – Only the pair with both final states is final Kleene Star – New start and final states,  -transisitions, and loop backs. – DFA to  -NFA

5 Transformations NFA to DFA – Subset construction, union of delta ranges DFA to Minimal DFA – Partition states into equivalence classes Reg Exp to NFA – Via GenNFA where transitions are on RE – Start with 2 states with RE as transition – Add new states by structure of RE on transition DFA to Reg Exp (Via GenNFA) – By state removal, – Remove states one at a time, and add RE to transitions

6 Acceptance algorithms DFA – Delta extension – Last state is amongst final states NFA – Delta extension to sets of states Reg Exp – Via empty predicate and derivatives of RE


Download ppt "Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these."

Similar presentations


Ads by Google