Nondeterministic Finite Automata. • Today: – Equivalence of NFA and DFA. – Regular Expressions. – Equivalence to Regular Languages. Equivalence of Machines.
every DFA is also an NFA this then shows that there is an NFA
By induction on the number of operators in the regex. Base case: L has a regular expression with 0 operators. Then the regex should be one of Ø ?
Label on remaining edge between start and accept states is a regular expression for language of original DFA. Remark: Method also can convert NFA into a regular
22 thg 7 2002 The technique described in this thesis converts a Finite Automata (as either a DFA or an. NFA)
Given DFA M will construct regular expression R such that L(M) = L(R). 2 Regular Expressions to NFA. Regular Expressions to Finite Automata.
Regular expressions NFAs
Convert Regular Expressions to Finite Automata. • High-level sketch. Regular expressions. NFA. DFA. Lexical. Specification. Table-driven.
In general how do we convert a regular expression to an NFA? A regular expression over ? is an expression formed by the following rules. ? The symbols ? and
First the regular expressions are studied then the Thomp- son [1] method is introduced to produce NFA from DFA. Similarly
regular expression – Build NFA – Convert NFA to DFA using subset construction – Minimize resulting DFA Theorem: A language is recognized by a DFA (or NFA) if and only if it has a regular expression You need to know this fact but we won’t ask you anything about the “only if” direction from DFA/NFA to regular expression For fun we
any regular expression is regular: Theorem: For any regular expression R there is an NFA N such that ?(R) = (? N) N has exactly one accepting state N has no transitions into its start state N has no transitions out of its accepting state
We will convert a DFA to a regular expression as follows: (A) Convert DFA to a NFA adding new initial and ?nal states (B) Remove all states one-by-one until we have only the initial and ?nal states
Lecture 24: NFAs Regular expressions and NFA ?DFA Nondeterministic Finite Automata (NFA) described by a regular expression there is an NFA that recognizes
Lecture 24: NFAs Regular expressions and NFA ?DFA Nondeterministic Finite Automata (NFA) • Graph with start state final states edges labeled by symbols (like DFA) but – Not required to have exactly 1 edge out of each state labeled by each symbol---can have 0 or >1 – Also can have edges labeled by empty string ?