Download presentation
Presentation is loading. Please wait.
1
1 Lecture 13 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA
2
2 Quick Review What is a configuration? What is a computation?
3
3 Finite State Automata New Computational Model
4
4 Finite State Automata (FSA) 1 2 a,b 1 2 a;a;R b;b;R a;a;R b;b;R Written character is identical to read character Tape head moves right one cell Model can be simplified by removing these elements
5
5 Formal Definition FSA M=(Q, ,q 0,A, ) –Q = set of states = {1,2} – = character set = {a,b} –q 0 = initial state = 1 –A = set of accepting (final) states = {1} – = state transition function Comments: –Read only –Tape head moves right 1 2 a,b
6
6 Exercise FSA M = (Q, , q 0, A, ) –Q = {1, 2, 3} – = {a, b} –q 0 = 1 –A = {2,3} – : { (1,a) = 1, (1,b) = 2, (2,a)= 2, (2,b) = 3, (3,a) = 3, (3,b) = 1} Draw this FSA as a transition diagram
7
7 Transition Diagram 1 2 3 a a a b b b
8
8 Computing with FSA’s
9
9 Computation Example (1, aabbaa) (1,abbaa) (1,bbaa) (2,baa) (3,aa) (3,a) (3 1 2 3 a a a b b b Input: aabbaa
10
10 Computation of FSA’s in detail A computation of an FSA M on an input x is a complete sequence of configurations We need to define –Initial configuration of the computation –How to determine the next configuration given the current configuration –Halting or final configurations of the computation
11
11 Given an FSA M and an input string x, what is the initial configuration of the computation of M on x? –(q 0,x) –Examples x = aabbaa (1, aabbaa) x = abab (1, abab) x = (1, ) Initial Configuration 1 2 3 a a a b b b FSA M
12
12 (1, aabbaa) |- M (1, abbaa) –config 1 “yields” config 2 in one step using FSA M (1,aabbaa) |- M (2, baa) –config 1 “yields” config 2 in 3 steps using FSA M (1, aabbaa) |- M (2, baa) –config 1 “yields” config 2 in 0 or more steps using FSA M Comment: –|- M determined by transition function –There must always be one and only one next configuration If not, M is not an FSA Definition of |- M 1 2 3 a a a b b b 3 FSA M *
13
13 Halting configuration –(q, ) –Examples (1, ) (3, ) Accepting Configuration –State in halting configuration is in A Rejecting Configuration –State in halting configuration is not in A Halting Configurations 1 2 3 a a a b b b FSA M
14
14 Two possibilities for M running on x –M accepts x M accepts x iff the computation of M on x ends up in an accepting configuration (q 0, x) |- M (q, ) where q is in A –M rejects x M rejects x iff the computation of M on x ends up in a rejecting configuration (q 0, x) |- M (q, ) where q is not in A –M does not loop or crash on x There is always one and only one next configuration. Tape head always moves right one cell until EOF FSA M on x b b b a a a FSA M * *
15
15 –For the following input strings, does M accept or reject? aa aabba aab babbb Examples b b b a a a FSA M
16
16 Notation from the book (q, c) = p k (q, x) = p * (q, cx) = p –q, p e Q –k is any integer r 1 –c e –x e * or k Examples – (1, a) = 1 – (1, b) = 2 – 4 (1, abbb) = 1 – * (1, abbb) = 1 – (2, baaaaa) = 1 Definition of * (q, x) 1 2 3 a a a b b b FSA M
17
17 L(M) –The set of strings M accepts –We say that M accepts/decides/recognizes L(M) No looping/crashing means accept/decide are equivalent –What is L(M) for the FSA M above? LFSA –L is in LFSA iff there exists an FSA M such that L(M) = L. Main goal for this unit –Understand language class LFSA L(M) and LFSA b b b a a a FSA M
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.