finite state automata n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Finite State Automata PowerPoint Presentation
Download Presentation
Finite State Automata

Loading in 2 Seconds...

play fullscreen
1 / 25

Finite State Automata - PowerPoint PPT Presentation


  • 455 Views
  • Uploaded on

Finite State Automata. Formal Specification of Languages. Generators Context-free Grammars Regular Expressions Recognizers Parsers, Push-down Automata Finite State Automata FSA is a mechanism to recognize a set of valid inputs before carrying out an action.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Finite State Automata' - Antony


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
formal specification of languages
Formal Specification of Languages
  • Generators
      • Context-free Grammars
      • Regular Expressions
  • Recognizers
      • Parsers, Push-down Automata
      • Finite State Automata
  • FSA is a mechanism to recognize a set of valid inputs before carrying out an action.
  • FSA is a notation for describing a family of language recognition algorithms.

L9FSA

parity problem
Parity Problem

1

0

EP

0

OP

1

L9FSA

basic features
Basic Features
  • Consumes the entire input string.
  • Remembers the parity of the bit string by abstracting from the number of 1s in the string.
  • Finite amount of memory required for this purpose.
      • Observe that counting requires unbounded memory, while computing the parity requires very small and fixed amount of memory.
  • Accepts/Rejects the input in a deterministic fashion.

L9FSA

slide5
State
      • Indicates the status of the machine after consuming some portion of the input.
      • Summarizes the history of the computation that is relevant to the future course of action.
  • Initial / Start State
  • Final / Accepting state
  • State Transition

0

1

Even Parity

Odd Parity

L9FSA

deterministic finite state automaton dfa
Deterministic Finite State Automaton (DFA)

Q: Finite set of states

S: Finite Alphabet

d: Transition function

total function from QxS to Q

: Initial/Start State

F : Set of final/accepting state

L9FSA

operation of the machine
Operation of the machine

0

0

1

Input Tape

  • Read the current letter of input under the tape head.
  • Transit to a new state depending on the current input and the current state, as dictated by the transition function.
  • Halt after consuming the entire input.

Finite Control

L9FSA

associating language with the dfa
Associating Language with the DFA
  • Machine configuration:
  • Yields relation:
  • Language:

L9FSA

slide10
Set of strings over {a,b} that contain bb
  • Design states by parititioning S*.
      • Strings containing bb q2
      • Strings not containing bb
        • Strings that end in b q1
        • Strings that do not end in b q0
    • Initial state: q0
    • Final state: q2

L9FSA

state diagram and table
State Diagram and Table

a

a

b

q0

q1

q2

b

a

b

L9FSA

slide13
DFA for the complement of L given DFA for L

Let M = (Q,S,d,q0,F) be a DFA. Then,

M’ = (Q,S,d,q0,Q-F) is a DFA with

L(M’) = S* - L(M).

Implication: Languages associated with DFAs are closed under complementation.

(Recall that languages associated with regular expressions are closed under union, concatenation, and Kleene Star operations, by definition.)

L9FSA

strings over a b containing even number of a s and odd number of b s
Strings over {a,b} containing even number of a’s and odd number of b’s.

S*

Ea

Oa

Eb

Ob

Eb

Ob

b

[Ea,Eb]

[Ea,Ob]

b

a

a

a

a

b

[Oa,Ob]

[Oa,Eb]

b

L9FSA

slide15
(ab)*c

S*

valid prefix

invalid prefix

end_a

end_b

end_c

a

a

Ea

Eb

b

c

a,c

l

b

c

Ec

Err

a,b,c

a,b,c

b

L9FSA

slide16
(ab)*c

S*

valid prefix

invalid prefix

end_a

end_b

end_c

a

Ea

Eb

b

c

a,c

b

Ec

Err

a,b,c

a,b,c

L9FSA

nondeterministic finite automata
Nondeterministic Finite Automata

a

a

qi

qi

qj

qj

a

DFA

a

qk

q

NFA

L9FSA

slide18
How do we associate a language with an NFA?
  • Every DFA is an NFA. However, does non-determinism make NFAs strictly more expressive (powerful) than DFAs?

DFA: Unique computation for a given string

NFA: Accept if there exists an accepting computation

L9FSA

slide20

Halts in non-accepting state after consuming the input.

Halts in accepting state

after consuming the input.

L9FSA

nfa state diagram a u b bb a u b

a

b

b

a

q0

q1

q2

b

b

NFA State Diagram (a Ub)*bb (a Ub)*

DFA

a

b

a

q0

q1

q2

b

b

a

L9FSA

nfa for a u b aa u bb a u b

a

b

b

a

q0

q1

q2

a

a

NFA for (a Ub)*(aaUbb)(a Ub)*

a

b

q11

q22

b

b

L9FSA

introducing l transitions into nfa
Introducing l-transitions into NFA
  • A l-transition causes the machine to change its state non-deterministically, without consuming any input.

L9FSA

closure properties of nfa l s
Closure Properties of NFA-ls

l

l

M1

l

l

M

M2

l

l

L(M)*

L(M1) UL(M2)

l

l

l

M1

M2

L(M1) L(M2)

L9FSA

slide25

a1

a2

a3

a3

b3

b1

b2

b3

a

a

a

a

a0

an

b

b

b

b

b

b

b

bn

This construction cannot be generalized to recognize

because the machine will have infinite number of states.

L9FSA