0% found this document useful (0 votes)
145 views23 pages

Junaid Khan Department of Computer Science University of Peshawar Pakistan Presented by

Transition graphs are a theoretical machine that are non-deterministic but simple. They consist of states, an input alphabet, and transitions between states labeled with regular expressions over the alphabet. A path through the graph that starts at a start state and ends at an accepting state accepts a word. Transition graphs can represent languages and are equivalent in power to finite automata. They allow for non-determinism through choices in transitions.

Uploaded by

Junaid khan
Copyright
© Attribution Non-Commercial (BY-NC)
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)
145 views23 pages

Junaid Khan Department of Computer Science University of Peshawar Pakistan Presented by

Transition graphs are a theoretical machine that are non-deterministic but simple. They consist of states, an input alphabet, and transitions between states labeled with regular expressions over the alphabet. A path through the graph that starts at a start state and ends at an accepting state accepts a word. Transition graphs can represent languages and are equivalent in power to finite automata. They allow for non-determinism through choices in transitions.

Uploaded by

Junaid khan
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 23

Presented By

Junaid Khan
Department of Computer Science University of
Peshawar Pakistan
[email protected]
Transition Graphs

We introduce the first non-deterministic but simple


theoretical machine: Transition Graph.
Transition Graphs
 A transition graph (TG) is the following 3 things:
1. a finite set of states, at least one of which is designated as
the start state, and some (maybe none) of which are
designated the final states (or accepting states)
2. an alphabet  of input letters
3. 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 ^ )
Transition Graphs
 A successful path is a series of edges beginning at
some start state and ending at a final state.
 The concatenation of all the substrings that label the
edges in the path is a word accepted by this machine.
 The set of words accepted is the language of the
transition graph.
Transition Graphs
b a a +

a b b a,b

 An FA: {baa} a,b


 The word a?
 The word baabb?
 The input fails, or the machine fails on the
input. The input is rejected.
Transition Graphs

ba a

– b +

aa, ab, bb a,b


a,b
 A transition graph that accepts the language {baa}
What it seems to be a More Powerful Machine
Transition Graphs
Two other equivalent Transition Graphs with fewer states
baa baa
– + – +

all else a,b


The word a? The word baabb?

 The input crashes. The machine crashes.


a,b The input is rejected.
(2 ways for an input to be rejected)
Transition Graphs
a,b a,b
aa,bb
– +
 baa?
 a choice, a decision
2 possible paths b|aa - accepted
b|a|a - rejected
1 way to crash ba|a – rejected
 The machine represents a language L. baa  L
Transition Graphs
1
ba ab

– +

baa 2 b

 baab? 2 possible paths, both end in a


final state.
Transition Graphs
 Example:
 a 4
1 abb 2 3
– +

aa
b

abbaab 1 2


3 1 4

abb aa b

abbab crashes.
Transition Graphs
Many start states
1 1

 a
a
b  2 b +
2– + –

3 aba  3 aba

 These two machines are clearly equivalent.


 Remark: Every finite automaton is a transition graph.
Transition Graphs

– +

L= L = {}

– 
+
abba –
baa

L = {, abba, baa}


Transition Graphs
L = {Λ} 
+ +


 
– + – +
Transition Graphs
All words ending in b: (a+b)*b

a,b a FA b
b
b – +
– +
a

transition graph:
Some words can fail, crash, and succeed: abab.
Transition Graphs
a,b
b
+
a
– a,b
b
a
+
aa b

b b b +

aa
Transition Graphs
Language EVEN-EVEN

FA: Transition Graph:


b
1 even a
even a aa,bb aa,bb
2 odd b
even b + b ab,ba
+
a a a a ab,ba
balanced unbalanced
b
odd a
odd a 3 4
b odd b
even b
Transition Graphs
 

a a +

 Infinitely many paths for aa


Transition Graphs

– a a +

We can delete the  transition

a, 
– a a +

b, 

But not here


Transition Graphs
 A generalized transition graph (GTG) is the
following 3 things:
1. a finite set of states, at least one of which is
designated as the start state, and some (maybe
none) of which are designated the final states (or
accepting states)
2. an alphabet  of input letters

3. a finite set of edges connecting some pairs of


states, each labeled with a regular expression
Transition Graphs
Words without 2 b’s in a row:

a* a*

(ba+a)* b+ +
+
Transition Graphs
Kleene Star Closure and Loops
b a,b

a,b a +

(a+b)*

(a+b) b* a +

Transition Graphs
Choosing Transitions

4 … b 4 …
abb ab

… 3 … 3

abb abb
5 … 5 …
Transition Graphs
Choices even with restriction of 1 letter per edge
8 … Machine is nondeterministic
a

… 7 b 9 …
b
8 …
1 … a
0
… 7 b 9 …
 b 1
0

You might also like