1 / 6

Regular Language Algorithms

Regular Language Algorithms. 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. Trivial algorithms.

shaman
Download Presentation

Regular Language Algorithms

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. 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 L-NFA • NFA to GenNFA • A DFA is a quintupleD=(Q,S,s,F,d) • d:QS ¾®Q • An NFA is a quintupleN=(Q,S,s,F,T) • T: Q  S ¾® Set(Q) • A L-NFA is a quintupleL=(Q,S,s,F,d) • d:Q (S È L) ¾®Set(Q) • GenNFA is a quintuple A=(Q,S,s,F,d) • d: Q  Q  ¾® RegExp(S) • 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, L-transisitions, and loop backs. • DFA to L-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

More Related