1 / 135

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012. 1. Content Finite Automata, FA Deterministic Finite Automata, DFA Nondeterministic Automata NFA NFA  DFA Equivalence.

ova
Télécharger la présentation

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3

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. CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012 1

  2. Content • Finite Automata, FA • Deterministic Finite Automata, DFA • Nondeterministic Automata NFA • NFA  DFA Equivalence

  3. Finite Automata FA (Finite State Machines) Based on C Busch, RPI, Models of Computation

  4. There is no formal general definition for "automaton". Instead, there are various kinds of automata, each with it's own formal definition. Generally, an automaton • has some form of input • has some form of output • has internal states • may or may not have some form of storage • is hard-wired rather than programmable

  5. Finite Automaton Input String Output Finite Automaton String

  6. Input String Output “Accept” or “Reject” Finite Automaton Finite Accepter

  7. Finite Automaton as Directed Graph • Nodes = States • Edges = Transitions • An edge with several symbols is a short-hand for several edges:

  8. Deterministic Finite Automata DFA

  9. DFA • Deterministic • there is no element of choice • Finite • only a finite number of states and arcs • Acceptors • produce only a yes/no answer

  10. Alphabet = Transition Graph abba -Finite Acceptor initial state final state “accept” transition state

  11. : set of states : input alphabet : transition function : initial state : set of final states Formal Definition • Deterministic Finite Accepter (DFA)

  12. Set of States

  13. Input Alphabet

  14. Initial State

  15. Set of Final States

  16. Transition Function

  17. Transition Function

  18. Extended Transition Function

  19. Observation: There is a walk from to with the label

  20. Recursive Definition

  21. ( ) d = * q , ab 0 ( ) d d = * ( q , a ), b 0 ( ( ( ) ) ) d d d l = * q , , a , b 0 ( ( ) ) d d = q , a , b 0 ( ) q d = q , b 2 1

  22. String Acceptance • Definition: • A string w is accepted by DFA M if w drives M to a final state from the initial state. • Formally: M accepts w iff

  23. abbbaa is NOT accepted

  24. abba is accepted

  25. Language Accepted by DFA • Take a DFA • Definition: • The language contains • all input strings accepted by • = strings that drive to a final state

  26. Alphabet = Example accept

  27. Alphabet = Another Example accept accept accept

  28. Formally • For a DFA • Language accepted by : alphabet transition function initial state final states

  29. Language rejected by Observation • Language accepted by

  30. Alphabet = More Examples accept trap state

  31. Alphabet = = { all strings with prefix } accept

  32. = { all strings without substring } Alphabet =

  33. Regular Languages A language is regular if there is a DFA such that All regular languages form a language family

  34. Alphabet = Example The language is regular

  35. Nondeterministic Finite Automata NFA

  36. NFA • Nondeterministic • there is an element of choice: in a given state NFA can act on a given string in different ways. Several start/final states are allowed. -transitions are allowed. • Finite • only a finite number of states and arcs • Acceptors • produce only a yes/no answer

  37. Nondeterministic Finite Accepter (NFA) Alphabet = Two choices

  38. First Choice

  39. First Choice

  40. First Choice

  41. First Choice “accept”

  42. Second Choice

  43. Second Choice

  44. Second Choice No transition: the automaton hangs

  45. Second Choice “reject”

More Related