Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Finite Automata: Understanding States and Transitions, Slides of Theory of Automata

Finite automata are collections of states with transition rules that determine how to move from one state to another. Originally used in sequential switching circuits, they are now applied to various types of software. How to represent finite automata, recognize strings, convert automata to code, and discusses an extended example of a strange planet's breeding system.

Typology: Slides

2012/2013

Uploaded on 04/29/2013

juni
juni šŸ‡®šŸ‡³

4

(16)

136 documents

1 / 22

Toggle sidebar

Related documents


Partial preview of the text

Download Finite Automata: Understanding States and Transitions and more Slides Theory of Automata in PDF only on Docsity! 1 Finite Automata Motivation An Example Docsity.com 2 Informal Explanation ļµFinite automata are finite collections of states with transition rules that take you from one state to another. ļµOriginal application was sequential switching circuits, where the ā€œstateā€ was the settings of internal bits. ļµToday, several kinds of software can be modeled by FA. Docsity.com 5 Automata to Code ļµ In C/C++, make a piece of code for each state. This code: 1. Reads the next input. 2. Decides on the next state. 3. Jumps to the beginning of the code for that state. Docsity.com 6 Example: Automata to Code 2: /* i seen */ c = getNextInput(); if (c == ā€™nā€™) goto 3; else if (c == ā€™iā€™) goto 2; else goto 1; 3: /* ā€inā€ seen */ . . . Docsity.com 7 Automata to Code ā€“ Thoughts ļµHow would you do this in Java, which has no goto? ļµYou donā€™t really write code like this. ļµRather, a code generator takes a ā€œregular expressionā€ describing the pattern(s) you are looking for. ļ· Example: .*ing works in grep. Docsity.com 10 Strange Planet ā€“ (2) ļµObservation: the number of individuals never changes. ļµThe planet fails if at some point all individuals are of the same species. ļ· Then, no more breeding can take place. ļµState = sequence of three integers ā€“ the numbers of individuals of species a, b, and c. Docsity.com 11 Strange Planet ā€“ Questions ļµIn a given state, must the planet eventually fail? ļµIn a given state, is it possible for the planet to fail, if the wrong breeding choices are made? Docsity.com 12 Questions ā€“ (2) ļµThese questions mirror real ones about protocols. ļ· ā€œCan the planet fail?ā€ is like asking whether a protocol can enter some undesired or error state. ļ· ā€œMust the planet failā€ is like asking whether a protocol is guaranteed to terminate. ā€¢ Here, ā€œfailureā€ is really the good condition of termination. Docsity.com 15 Strange Planet with 3 Individuals 300 003030 111 a c b Notice: four states are ā€œmust-failā€ states. The others are ā€œcanā€™t-failā€ states. 102210 a c 201021 bb 012120 a c State 111 has several transitions. Docsity.com 16 Strange Planet with 4 Individuals Notice: states 400, etc. are must-fail states. All other states are ā€œmight-failā€ states. 400 022 130103 211 a c b b c a 040 202 013310 121 b a c c a b 004 220 301031 112 c b a a b c Docsity.com 17 Taking Advantage of Symmetry ļµThe ability to fail depends only on the set of numbers of the three species, not on which species has which number. ļµLetā€™s represent states by the list of counts, sorted by largest-first. ļµOnly one transition symbol, x. Docsity.com 20 6 Individuals 321 600 411 330 222 Notice: 600 is a must-fail state; 510, 420, and 321 are canā€™t-fail states; 411, 330, and 222 are ā€œmight-failā€ states. 420 510 Docsity.com 21 7 Individuals 331 700 430 421 322 Notice: 700 is a must-fail state; All others are might-fail states. 511 520 610 Docsity.com 22 Questions for Thought 1. Without symmetry, how many states are there with n individuals? 2. What if we use symmetry? 3. For n individuals, how do you tell whether a state is ā€œmust-fail,ā€ ā€œmight- fail,ā€ or ā€œcanā€™t-failā€? Docsity.com
Docsity logo



Copyright Ā© 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved