Discete Mthemtics nd Logic II. Automt SFWR ENG 2FA3 Ryszd Jnicki Winte 2014 Acknowledgments: Mteil sed on Automt nd Computility y Dexte C. Kozen (Chpte 3). Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 1 / 15
Sttes nd Tnsitions A stte o system cn e seen s is n instntneous desciption o tht system A stte gives ll elevnt inomtion necessy to detemine how the system cn evolve om tht point on Tnsitions e chnges o stte Tnsitions cn hppen spontneously o in esponse to extenl inputs Assumption: stte tnsitions e instntneous A system tht consists o only nitely mny sttes nd tnsitions mong them is clled nite-stte tnsition system Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 2 / 15
Sttes nd Tnsitions q0 Geen 5 min () q1 Yellow 5 min () 1 min () q2 Red Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 3 / 15
Sttes nd Tnsitions q0 q1 q2 Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 4 / 15
Sttes nd Tnsitions Yellow : ek down : epi Geen Fil Red Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 5 / 15
Finite Automt We model these stctly y mthemticl model clled nite utomton Denition (Deteministic nite utomton) Fomlly, deteministic nite utomton (DFA) is stuctue M = (Q, Σ, δ, s, F ), whee Q is nite set o sttes; Σ is nite set clled input lphet; δ : Q Σ Q is the tnsition unction s Q is the stt stte; F is suset o Q ; elements o F e clled ccept o nl sttes. Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 6 / 15
Finite Automt Yellow : ek down : epi Geen Fil Q = {Red, Yellow, Geen, Fil} Red Σ = {,,, } δ = {((Red, ), Geen), ((Red, ), Fil), ((Geen, ), Yellow), ((Geen, ), Fil), ((Yellow, ), Red), ((Yellow, ), Fil), ((Fil, ), Red)} s = Red F = {Fil} Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 7 / 15
Finite Automt Repesenttions o unction Enumetion Tle δ = {((Red, ), Geen), ((Red, ), Fil), ((Geen, ), Yellow), ((Geen, ), Fil), ((Yellow, ), Red), ((Yellow, ), Fil), ((Fil, ), Red)} Red Geen - Fil - Geen Yellow - Fil Yellow - Red Fil Fil - - - Red Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 8 / 15
Finite Automt Yellow : ek down : epi Geen Fil Red Yellow Geen Fil Red Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 9 / 15
Finite Automt An utomton is specied y giving its 5 pts Tnsition digm Yellow Geen Fil Red Tul epesenttion o n utomton Red Geen Red Fil Red Geen Yellow Geen Fil Geen Yellow Yellow Red Fil Yellow Fil (F) Fil Fil Fil Red Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 10 / 15
Finite Automt How nite utomton M = (Q, Σ, δ, s, F ) opetes (Inomlly) An input cn e sting x Σ Mke mk on on the stt stte s Scn the input sting x om let to ight, one symol t time, moving the mk ccoding δ When we come to the end o the input sting, the mk is on some stte p The sting x is sid to e ccepted y the mchine M i p F nd ejected i p F Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 11 / 15
Finite Automt How nite utomton M = (Q, Σ, δ, s, F ) opetes (Fomlly) Fom δ nd y induction on the length o x, we dene unction s ollows: δ : Q Σ Q δ (q, ɛ) de = q Bse cse ) δ (q, x) de = δ ( δ (q, x), Inductive cse A sting x is sid to e ccepted y the utomton M i δ (s, x) F nd ejected y the utomton M i δ (s, x) F Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 12 / 15
Lnguge nd egul set Denition (Lnguge) The set o lnguge ccepted y M = (Q, Σ, δ, s, F ) is the set o ll stings ccepted y M nd is denoted L(M): L(M) de = {x Σ δ (s, x) F } Denition (Regul set) A suset A Σ is sid to e egul i A = L(M) o some nite utomton M. Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 13 / 15
Lnguge nd egul set Exmple λ Even Odd 1 L(M) =? 2 Is {x {, } x contins n odd nume o 's nd even nume o 's} egul set? Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 14 / 15
Lnguge nd egul set Exmple (Solutions) 1 L(M) = {x {, } x contins n even nume o 's nd ity nume o 's} 2 Is {x {, } x contins n odd nume o 's nd even nume o 's} egul set? Yes, see the utomton elow. Ryszd Jnicki Discete Mthemtics nd Logic II. Automt 15 / 15