Theory of Automata: Transition Graphs
Theory of Automata: Transition Graphs
Transition Graphs
Dr Aftab Maroof
Nasreen Akhtar
Faryal Saud
Contents
10/6/2019 2
Relaxing the Restriction on
Inputs
10/6/2019 3
Relaxing the restrictions on inputs
Beginning at the start state, anything but the string baa will
drop down into the garbage collecting state and never be
seen again. Even the string baabb will fail.
Hence the language accepted by this FA is L = {baa}
10/6/2019 4
Relaxing restrictions on input
Let us relax the restriction that an FA can only read one letter
from the input string at a time
10/6/2019 5
Relax restrictions on input
10/6/2019 6
Relaxing restrictions on input
The picture on the last page tells us that when the input fails to be of the desired
form, we must go to the garbage collection state and read through the rest of
the input, knowing that we can never leave there.
– We also have problem even with the input baaa. The first three letters take us to the
accept state, but then the picture does not tell us where to go when the last a is read.
(Remember that according to the rules of FAs, one cannot stop reading input letters
until the input string completely runs out.)
With this assumption, we can consider the two pictures above to be equivalent,
in the sense that they accept the exact same language.
10/6/2019 7
Relaxing restrictions on input
Definition: When an input string that has NOT been completely read
reaches a state (final or otherwise) that it cannot leave because there is no
outgoing edge that it may follow, we say that the input (or the machine)
crashes at that state. Execution then terminates and the input must be
rejected.
Note that on an FA it is not possible for any input to crash because there are
always an outgoing a-edge and an outgoing b-edge from each state. As long as
there remains input letters unread, progress is possible.
There are now two different ways that an input can be rejected: (i) It could
peacefully trace a path ending in a non-final state, or (ii) it could crash while
being processed.
10/6/2019 8
If we hypothesize that a machine can read one or two letters at a time,
then one may build a machine using only two states that can recognize
all words containing a double letter (aa or bb) as follows:
10/6/2019 9
As an example for the problems of making choices, let us say that the
input is baa.
If we first read b and then read aa we will go to the final state. Hence,
the string is accepted.
If we first read b, then read a, and then read a, we will loop back and be
stuck at the start state. Hence, the string is rejected in this case.
What shall we say? Is this input string a word in the language of this
machine or not?
10/6/2019 10
The above problems tell us that if we change the definition of our
machine to allow for more than one letter to be read at a time, we must
also change the definition of acceptance.
10/6/2019 11
Definition of A Transition Graph
10/6/2019 12
We should note the following from the definition of a TG:
10/6/2019 13
Example
The path from state 1 to state 2 to state 3 back to state 1 and then to
the final state 4 corresponds to the string (abb)(Λ)(aa)(b) = abbaab.
When an edge is labeled with Λ, it means that we can take the ride it
offers for free (without consuming any letter from the input string).
10/6/2019 14
Example contd.
10/6/2019 15
Because we allow some edges to be traversed for free, it is
logical to allow for the possibility of more than one start state,
as illustrated below:
These two machines are equivalent, in the sense that all the
strings accepted by the first are accepted by the second and
vise versa.
Important Note: Every FA is also a TG. However, NOT
every TG satisfies the definition of an FA.
10/6/2019 16
Looking at TGs
10/6/2019 17
Example
10/6/2019 18
Example
10/6/2019 19
Example
10/6/2019 20
Example
We can read all the input letters, one at a time, and stay in the
left-side state. When we read a b, if it is the very last letter of the
input string, we can use it to go to the final state. Note that this b
must be the very last letter, because once we are in the right-side
state, if we try to read another letter, we will crash.
10/6/2019 21
Example
In this TG, every edge is labeled with a pair of letters. Thus, for a
string to be accepted, it must have an even number of letters.
Let’s call the left state the balanced state, and the right state the
unbalanced state.
If the first pair of letters that we read is a double (aa or bb), then
we stay in the balanced state. While in the balanced state, we
have read an even number of a’s and an even number of b’s.
10/6/2019 22
EVEN-EVEN
10/6/2019 23
Quiz-
10/6/2019 24
Quiz-2
10/6/2019 25
Generalized Transition
Graphs (GTG)
10/6/2019 26
Definition
10/6/2019 27
Example
10/6/2019 28
Note that there is no difference between the Kleene star
closure for regular expressions and a loop in transition
graphs, as illustrated in the following figure:
10/6/2019 29
NonDeterminism
10/6/2019 30
NonDeterminism
10/6/2019 31
NonDeterminism
10/6/2019 32