1 / 16

Learning Outcomes

Learning Outcomes. Mahasiswa dpt membandingkan berbagai bentuk algoritma FA untuk suatu ekspresi/Syntax program agar dapat dianalisis diterima/ditolak. Outline Materi:. FA sebagai model komputasi Gambaran FA dgn digraph Definisi formal Analisis FA NFA Aplikasi state transduser. b. b. b.

shad-fox
Download Presentation

Learning Outcomes

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. Learning Outcomes • Mahasiswa dpt membandingkan berbagai bentuk algoritma FA untuk suatu ekspresi/Syntax program agar dapat dianalisis diterima/ditolak..

  2. Outline Materi: • FA sebagai model komputasi • Gambaran FA dgn digraph • Definisi formal • Analisis FA • NFA • Aplikasi state transduser

  3. b b b s p q r > a a a a b t a b Deterministic Finite Automata (DFA) For every state q in Q and every character  in , one and only one transition of the following form occurs:  q q’

  4. Expressiveness of DFA • DFA are a type of programs • Contains concepts of imperative languages: sequences, branching and loops. • Can implement a newspaper vendor machine (see Page 20 of the book) • Can implement pattern matching: find all text containing “Britney Spears” (or “Justin Timberlake”) • Can only implement programs that require a constant amount of memory

  5. Another Example a b A b b a a r r s q q > a a L(A) is the set of all strings having 2 consecutive a’s b a a B a b r r s q q > b L(B) is the set of all strings having 2 consecutive b’s b

  6. Nondeterministic Finite Automata a b a a r r q q b a s > b a b b r’ r q q’ a a b Automaton accepting strings containing 2 a’s or 2 b’s Deterministic?

  7. occurs • No transition: q q’  occurs • One or more transition: q q’  p … Nondeterministic Finite Automata (NFA) For every state q in S and every character  in , one of the following will happen:

  8. 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 initial state • F  Q called the favorable states •   Q × ( × {e}) × Q

  9. “the empty string” e q q’ Nondeterministic Finite Automata (NFA) What else can occur in NFAs? If we start with the configuration (q,aaabbb) and apply this transition, what is the resulting configuration? (q’, aaabbb) “e-transitions” do not process any characters, they just allow to “jump” between states

  10. String Accepted by NFA Given an NFA A = (Q,,,s,F), and a string w *, we say that w is accepted by A if at least one of the configurations yielded by (s,w) is a configuration of the form (f,e) with f a favorable state What is the language accepted by an NFA? L(A) = {w * : w is accepted by A}

  11. Example a r r s q q > b b b

  12. Example # 2 a b a a r r q q b a s > b a b b r’ r q q’ a a b

  13. p Suppose that while processing a configuration (r,w) only by going to state p, a favorable state can be reached. Then, the oracle will choose p a r e q NFA vs DFA • Are deterministic automata, nondeterministic? • The oracle explanation of NFAs: there is an oracle that always makes the right choice • Is the oracle explanation compatible with our definition of acceptability in NFAs?

  14. a r r s q q > b b b NFA vs DFA (2) Are NFAs more powerful than DFAs? (i.e., are there languages that can be recognized by NFAs but not by DFAs)

  15. NFA vs DFA (3) a b a a r r q q b a s > b a b b r’ r q q’ a a b

  16. Terima kasih Selamat belajar

More Related