Presentation is loading. Please wait.

Presentation is loading. Please wait.

COP4620 – Programming Language Translators Dr. Manuel E. Bermudez

Similar presentations


Presentation on theme: "COP4620 – Programming Language Translators Dr. Manuel E. Bermudez"— Presentation transcript:

1 COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
NFA->DFA COP4620 – Programming Language Translators Dr. Manuel E. Bermudez

2 NFA->DFA RGR RGL Minimum DFA RE NFA DFA Done Soon Now

3 NFA->DFA Deterministic Finite-State Automata (DFA’s)
Definition: A deterministic FSA is defined just like an NFA, except that δ: Q x Σ → Q, rather than δ: Q x Σ U {ε}→ 2Q Thus, both and are impossible. For every NFA there exists an equivalent DFA (accepting the same language). ε a

4 NFA->DFA Conversion from NFA’s to DFA’s:
Simulate NFA moves with the DFA. DFA start state: NFA start state S, and all ε-reachable states from S. Each DFA state: a subset of the set of NFA states. New DFA states: Calculate the states reachable through each t  Σ. Final DFA states: contain any NFA final state.

5 NFA->DFA In general, if NFA has N states,
ε b 1 3 4 2 5 6 a NFA: Input State a b In general, if NFA has N states, The DFA can have as many as 2N states. a b 123 23 456 56 6 DFA:

6 NFA->DFA ε a 3 5 6 4 7 8 b 1 2 10 9 11 NFA: from ba(a+b)*ab DFA: a
1 2 10 9 11 NFA: from ba(a+b)*ab NFA->DFA State a b DFA: a b 234689 346789 1

7 NFA->DFA RGR RGL Minimum DFA RE NFA DFA Done Soon Done


Download ppt "COP4620 – Programming Language Translators Dr. Manuel E. Bermudez"

Similar presentations


Ads by Google