Sei sulla pagina 1di 4

Tahir Naseem/Handout 12

-1-

Theory of Automata and Formal Languages

Lecture 12
Objectives
Transition Graph
o More Powerful Machine
o Formal Definition
o Examples
A Generalized Transition Graph
Kleens Theorem
Transition Graph

Transition graph (TG) is more powerful machine than FSA.

It has an ability to read sequence of letters instead a single letter like FSA.

To accept baa FSA needs 5 sates and TG needs only two states.

In TG nondeterminism exist; because there can be many outgoing transitions with


same label from same state. Also there will be a chance of no transition for some
particular letter of alphabet set.

Due to nondeterminism; when an input string that has not been completely read
reaches a state that it cannot leave because there is no outgoing edge that it may
follow, we sat that the input crashes at that state. Execution then terminates and the
input must be rejected.

Formal Definition
A Transition graph, abbreviated TG, is a collection of three thins:

A finite set of states, at least one of which is designated as the start state (- ) and some
(may be none) of which are designated as final states (+).

An alphabet of possible input letters from which input strings are formed.

A finite set of transitions (edge labels) that show how to go from some states to some
others, based on reading specified substring of input letters (possibly even the null
string )

Tahir Naseem/Handout 12

-2-

Theory of Automata and Formal Languages

A successful path through a transition graph is a series of edges forming a path


beginning at some start state 9there may be several) and ending at a final state. If we
concatenate in order the string of letters that each edge in the path, we produce a word
that is accepted by this machine.

Example 1: TG that accepts a+b+aba


2
a

-1

+5

b
aba

4
Example 2: (Another way to build TG): TG that accepts a+b+aba

-1

a+b+aba

+2

Example 3: Build a TG over the alphabet = {0,1} having double a or double b.

Tahir Naseem/Handout 12

-3-

Theory of Automata and Formal Languages

Example 4: Build a TG over the alphabet = {a, b} having starting and ending with different
letter.

Generalized Transition Graph


Generalized Transition Graph (GTG) is a collection of three things:
A finite set of states, of which at least one is a start state and some (may be
none ) are final states
An alphabet of input letters.
Directed edges connecting some pairs of states, each labeled with a regular
expression.
Example 1:
-1

(ab + a)+

(b + )

+3

Tahir Naseem/Handout 12

-4-

Theory of Automata and Formal Languages

Example 2: Beginning and ending with same letter.

Kleens Theorem
Any language that can be defined by
o Regular Expression or
o Finite Automaton or
o Transition Graph
can be defined by all three methods
Proof:
This theorem can be proved by proving following
Converting TG into Regular Expression
Converting Regular Expression into TG
o Already proved because you can make a TG with regular expression as a label.
Converting Finite Automat into Regular Expression
Converting Regular Expression into Finite State Automata.
Converting NFA into DFA
o NFA is just like TG, so TG to DFA will be proved.
Converting DFA to TG
o Already proved because every DFA is always a TG.

Potrebbero piacerti anche