



































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




































An automaton that accepts all legal Pascal identifiers: 1 2 3 Lette r Digit Letter or Digit Letter or Digit "yes" "no" 2
Control unit q 0 Input file yes/no
M = (Q, , , q 0 , F)
(q 0 , a) = q 1 & (q 1 , b) = q 2 *(q 0 , ab) = q 2
(q 0 , a) = q 1 & (q 1 , b) = q 2 (q 0 , ab) = q 2 (q, ) = q (q, wa) = ((q, w), a)
M = ({q 0 , q 1 , q 2 }, {a, b}, , q 0 , {q 1 }) L(M) =? q 0 q 1 q 2 a, b a, b a b
M = ({q 0 , q 1 , q 2 }, {a, b}, , q 0 , {q 1 }) L(M) = {anb | n 0} trap state q 0 q 1 q 2 a, b a, b a b
L(M) = {w{a, b}*^ | w starts with ab}
L(M) = {w{a, b}*^ | w starts with ab} q 0 q 1 q 2 b a, b b a q 3 trap state a a, b
L(M) = {w{0, 1}*^ | w does not contain 001} 0 001 0 0, 1 1 1 00 0 1 0 trap state
L is regular iff L = L(M) for some DFA M
L = {awa | w{a, b}*} q 0 q 2 q 3 b a b a trap state q 1 a a, b b
L = {awa | w{a, b}} L^2 = {aw 1 aaw 2 a | w 1 , w 2 {a, b}}