1 / 98

Finite-State Machines with No Output Ying Lu

Based on Slides by Elsa L Gunter, NJIT, Costas Busch , and Longin Jan Latecki, Temple University. Finite-State Machines with No Output Ying Lu. Kleene closure. A and B are two sets of strings. The concatenation of A and B is AB={xy: x string in A and y string in B}

johnna
Download Presentation

Finite-State Machines with No Output Ying Lu

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. Based on Slides by Elsa L Gunter, NJIT, Costas Busch, and Longin Jan Latecki, Temple University Finite-State Machines with No OutputYing Lu

  2. Kleene closure • A and B are two sets of strings. The concatenation of A and B isAB={xy: x string in A and y string in B} • Example: A={0, 11} and B={1, 10, 110}AB={01,010,0110,111,1110,11110} • A0={λ}, where λ represents the empty stringAn+1=AnA for n=0,1,2,…

  3. Let A be any set of strings formed of characters in V. Kleene closure of A, denoted by A*, is Examples: If C={11}, then C*={12n: n=0,1,2,…} If B={0,1}, then B*={all binary strings}.

  4. Finite State Automata • A FSA is similar to a compiler in that: • A compiler recognizes legal programs in some (source) language. • A finite-state machine recognizes legal strings in some language. • Example: Pascal Identifiers • sequences of one or more letters or digits, starting with a letter: letter | digit letter S A

  5. Finite Automaton Input String Output “Accept” or “Reject” Finite Automaton

  6. Finite State Automata • A finite state automaton over an alphabet is illustrated by a state diagram: • a directed graph • edges are labeled with elements of alphabet, • some nodes (or states), marked as final • one node marked as start state

  7. Transition Graph initial state accepting state transition state

  8. Initial Configuration Input String

  9. Reading the Input

  10. Input finished accept

  11. Rejection

  12. Input finished reject

  13. Another Rejection

  14. reject

  15. Another Example

  16. Input finished accept

  17. Rejection Example

  18. Input finished reject

  19. Finite State Automata • A finite state automaton M=(S,Σ,δ,s0,F) consists of • a finite set S of states, • a finite input alphabet Σ, • a state transition function δ: S x Σ S, • an initial state s0, • F subset of S that represent the final states.

  20. Finite Automata • Transition • Is read ‘In state s1 on input “a” go to state s2’ • At the end of input • If in accepting state => accept • Otherwise => reject • If no transition possible (got stuck) => reject • FSA = Finite State Automata

  21. Input Alphabet

  22. Set of States

  23. Initial State

  24. Set of Accepting States

  25. Transition Function

  26. Transition Function

  27. Language accepted by FSA • The language accepted by a FSA is the set of strings accepted by the FSA. • in the language of the FSM shown below: x, tmp2, XyZzy, position27. • not in the language of the FSM shown below: • 123, a?, 13apples. letter | digit letter S A

  28. Example accept

  29. Example accept accept accept

  30. Example trap state accept

  31. Extended Transition Function

  32. Observation: if there is a walk from to with label then

More Related