0% found this document useful (0 votes)
18 views17 pages

Lecture 7

This document discusses generalized transition graphs (GTG), which are a type of automaton that generalizes transition graphs. A GTG consists of a set of states, an input alphabet, and directed edges between states labeled with regular expressions. GTGs can accept languages defined by regular expressions. They allow nondeterminism through the use of epsilon transitions and edges labeled with regular expressions. Examples of GTGs are provided to recognize various regular languages. The relationship between GTGs, finite automata, and nondeterministic finite automata is also examined.

Uploaded by

Zohaib Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views17 pages

Lecture 7

This document discusses generalized transition graphs (GTG), which are a type of automaton that generalizes transition graphs. A GTG consists of a set of states, an input alphabet, and directed edges between states labeled with regular expressions. GTGs can accept languages defined by regular expressions. They allow nondeterminism through the use of epsilon transitions and edges labeled with regular expressions. Examples of GTGs are provided to recognize various regular languages. The relationship between GTGs, finite automata, and nondeterministic finite automata is also examined.

Uploaded by

Zohaib Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Lecture 07: Theory of Automata:2011

Generalized Transition Graphs


(GTG)

University Institute of Information Technology, PMAS-AAUR


Lecture 07: Theory of Automata:2011

Definition
A generalized transition graph (GTG) is a collection of
three things:
1. A finite set of states, of which at least one is a start
state and some (maybe none) are final states.

2. An alphabet ∑ of input letters.

3. Directed edges connecting some pair of states labeled


with regular expression.

4. Directed edges connecting some pairs of states, each


labeled with a regular expression.
2
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example
• Consider this GTG:

• This GTG accepts all strings without a double b.


• Note that the word containing the single letter b can take
the free ride along the Λ-edge from start to middle, and
then have letter b read to go to the final state.

3
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• 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:

• In the first picture we may loop in the middle state or go


to the third state. To not loop corresponds to taking the Λ
choice from the b*-edge in the second picture.

4
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example
• Consider the language L of strings, defined over Σ =
{a,b}, containing double a or double b

• The language L can be expressed by the following


regular expression (a+b)* (aa + bb) (a+b)*
• The language L may be accepted by the following GTG.

5
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• Consider the Language L of strings, defined over Σ =


{a, b}, beginning with and ending in same letters.
• The language L may be expressed by the following
regular expression (a+b)+ a(a + b)*a + b(a + b)*b.
• This language may be accepted by the following GTG

6
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• Consider the language L of strings, defined over Σ =


{a, b}, having triple a or triple b.
• The language L may be expressed by RE (a+b)* (aaa +
bbb) (a+b)*
• This language may be accepted by the following GTG

7
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

TG vs GTG

8
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

FA vs GTG

University Institute of Information Technology, PMAS-AAUR 9


Lecture 07: Theory of Automata:2011

NonDeterminism
(NFA)

University Institute of Information Technology, PMAS-AAUR


Lecture 07: Theory of Automata:2011

NonDeterminism
• We have already seen that in a TG, a particular string of
input letters may trace through the machine on different
paths, depending on our choice of grouping.

• This figure shows part of some TG.

• The input string abb can go from state 3 to state 4, or to


state 5, depending on whether we read the letters two and
one, or all three at once.
11
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

NonDeterminism
• The ultimate path through the machine is NOT
determined by the input alone. Human choice becomes
a factor in selecting the path. The machine does not
make all its own determination.

• Therefore, we say that TGs are nondeterministic.

12
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

NonDeterminism

13
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example

University Institute of Information Technology, PMAS-AAUR 14


Lecture 07: Theory of Automata:2011

University Institute of Information Technology, PMAS-AAUR 15


Lecture 07: Theory of Automata:2011

• Accept Language that contains substring aa

University Institute of Information Technology, PMAS-AAUR 16


Lecture 07: Theory of Automata:2011

DFA vs NFA

University Institute of Information Technology, PMAS-AAUR 17

You might also like