1 / 8

Recap: Nondeterministic Finite Automaton (NFA)

Recap: Nondeterministic Finite Automaton (NFA). A deterministic finite automaton (NFA) is a 5-tuple (Q, ,,s,F) where: Q is a finite set of elements called states  is a finite input alphabet s  Q called the start state F  Q called the favorable states.

Download Presentation

Recap: Nondeterministic Finite Automaton (NFA)

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. Recap: Nondeterministic Finite Automaton (NFA) • A deterministic finite automaton (NFA) is a 5-tuple (Q,,,s,F) where: • Q is a finite set of elements called states •  is a finite input alphabet • s Q called the start state • F  Q called the favorable states • : (Q × (  {e}))  (Q) Constant! … a1 a2

  2. p Suppose that while processing a w from state r only by going to state p, a favorable state can be reached. Then, the oracle will choose p a r e q Acceptance of a Word in an NFA A • Acceptance: w is accepted by A if at least one sequence of transformations yields the empty word and end up in an accepting state • The oracle explanation of NFAs: there is an oracle that always makes the right choice Oracle will find a path to an accepting state that process all characters only if there is one such path

  3. Pushdown Automaton stack a’1 a’1 … • A pushdown automaton is a 6-tuple (Q,,, ,s,F) where: • Q is a finite set of elements called states •  is a finite input alphabet •  is a set of stack symbols • s Q called the start state • F  Q called the favorable states • : (Q × (  {e}) × (  {e})) (Q × (  {e})) Constant! … a1 a2

  4. Computation in Pushdown Automata PA = (Q,,, ,s,F) where: • :(Q × (  {e}) × (  {e})) (Q × (  {e})) Let (q’,))  ((q, ,)), it is compute as follows: • if: • the automaton is in an state q • the next character is  • The word  is on top of the stack • Then: • pop  from top of the stack • Jump to the state q’ • Push the word  on top of the stack

  5. String Accepted by Pushdown Automaton • Given a pushdown automaton A, and a string w *, we say that w is accepted by A if there is a sequence of computations that: • begin from the starting state, the word w, and the empty stack • terminates in a favorable state and process all characters in w • Note: the stack does not have to be empty at the end The set of all words accepted by an automaton A form the language L(A) accepted or recognized by the automaton.

  6. Example Pushdown automaton recognizing {anbn : n = 0, 1, 2, …}

  7. Example Pushdown automaton recognizing L = {wwR : w is in *}

  8. Homework for Friday 12. • 2.3 (n), (o) • 2.4 (c) • 2.6 (b) • 2.21 • Construct a pushdown automaton for the language of exercise 2.21

More Related