STM Unit - 3
STM Unit - 3
Interpret the control flowgraph and identify the path products, path sums
and path expressions.
Identify how the mathematical laws (distributive, associative, commutative
etc) holds for the paths.
Apply reduction procedure algorithm to a control flowgraph and simplify it
into a single path expression.
Find the all possible paths (Max. Path Count) of a given flow graph.
Find the minimum paths required to cover a given flow graph.
Calculate the probability of paths and understand the need for finding the
probabilities.
Differentiate betweeen Structured and Un-structured flowgraphs.
Calculate the mean processing time of a routine of a given flowgraph.
Understand how complimentary operations such as PUSH / POP or GET /
RETURN are interpreted in a flowgraph.
Identify the limitations of the above approaches.
Understand the problems due to flow-anomalies and identify whether
anomalies exist in the given path expression.
MOTIVATION:
o Flow graphs are being an abstract representation of programs.
o Any question about a program can be cast into an equivalent
question about an appropriate flowgraph.
o Most software development, testing and debugging tools use flow
graphs analysis techniques.
PATH PRODUCTS:
o Normally flow graphs used to denote only control flow
connectivity.
o The simplest weight we can give to a link is a name.
o Using link names as weights, we then convert the graphical flow
graph into an equivalent algebraic like expressions which denotes
the set of all possible paths from entry to exit for the flow graph.
o Every link of a graph can be given a name.
o The link name will be denoted by lower case italic letters.
o In tracing a path or path segment through a flow graph, you
traverse a succession of link names.
o The name of the path or path segment that corresponds to those
links is expressed naturally by concatenating those link names.
o For example, if you traverse links a,b,c and d along some path, the
name for that path segment is abcd. This path name is also called
a path product. Figure 5.1 shows some examples:
o
o PATH EXPRESSION:
Consider a pair of nodes in a graph and the set of paths between
those node.
Denote that set of paths by Upper case letter such as X,Y. From
Figure 5.1c, the members of the path set can be listed as follows:
ac+abc+abbc+abbbc+abbbbc+...........
The + sign is understood to mean "or" between the two nodes of
interest, paths ac, or abc, or abbc, and so on can be taken.
Any expression that consists of path names and "OR"s and which
denotes a set of paths between two nodes is called a "Path
Expression.".
o PATH PRODUCTS:
The name of a path that consists of two successive path segments
is conveniently expressed by the concatenation or Path Product of
the segment names.
For example, if X and Y are defined as X=abcde,Y=fghij,then the
path corresponding to X followed by Y is denoted by
XY=abcdefghij
Similarly,
YX=fghijabcde
aX=aabcde
Xa=abcdea
XaX=abcdeaabcde
If X and Y represent sets of paths or path expressions, their
product represents the set of paths that can be obtained by
following every element of X by any element of Y in all possible
ways. For example,
X = abc + def + ghi
Y = uvw + z
Then,
Similarly, if
X = abcde
then
X1 = abcde
X2 = abcdeabcde = (abcde)2
X3 = abcdeabcdeabcde = (abcde)2abcde
= abcde(abcde)2 = (abcde)3
RULE 1: A(BC)=(AB)C=ABC
where A,B,C are path names, set of path names or path expressions.
o DISTRIBUTIVE LAWS:
The product and sum operations are distributive, and the
ordinary rules of multiplication apply; that is
o LOOPS:
Loops can be understood as an infinite set of parallel
paths. Say that the loop consists of a single link b. then
the set of all paths through that loop point is
b0+b1+b2+b3+b4+b5+.............
ab*c=ac+abc+abbc+abbbc+................
o Evidently,
Xn = X0+X1+X2+X3+X4+X5+..................+Xn
RULES 6 - 16:
o The following rules can be derived from the previous rules:
n m n
o RULE 6: X + X = X if n>m
RULE 6: Xn + Xm = Xm if m>n
RULE 7: XnXm = Xn+m
RULE 8: XnX* = X*Xn = X*
RULE 9: XnX+ = X+Xn = X+
RULE 10: X*X+ = X+X* = X+
RULE 11: 1 + 1 = 1
RULE 12: 1X = X1 = X
Following or preceding a set of paths by a path of zero length
does not change the set.
RULE 13: 1n = 1n = 1* = 1+ = 1
No matter how often you traverse a path of zero length,It is a path
of zero length.
RULE 14: 1++1 = 1*=1
The null set of paths is denoted by the numeral 0. it obeys the
following rules:
RULE 15: X+0=0+X=X
RULE 16: 0X=X0=0
If you block the paths of a graph for or aft by a graph that has no
paths , there wont be any paths.
Reduction procedure, application: