1 / 135

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010. Content Finite Automata, FA Deterministic Finite Automata, DFA Nondeterministic Automata NFA NFA  DFA Equivalence. Finite Automata FA (Finite State Machines).

salome
Télécharger la présentation

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University

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. CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010

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

  3. Finite Automata FA (Finite State Machines)

  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. FA 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. Formally • For a DFA • Language accepted by : alphabet transition function initial state final states

  12. Language rejected by Observation • Language accepted by

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

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

  15. Input Aplhabet

  16. Set of States

  17. Initial State

  18. Set of Final States

  19. Transition Function

  20. Transition Function

  21. Extended Transition Function

  22. Observation: There is a walk from to with label

  23. Recursive Definition

  24. ( ) 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

  25. Languages Accepted by DFAs • Take 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. A language is regular if there is a DFA such that Regular Languages All regular languages form a language family

  34. Alphabet = Example The language is regular

  35. Nondeterministic 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

More Related