Professional Documents
Culture Documents
1.1 Introduction
Relations and digraphs (directed graphs) are ubiquitous in the the-
ory of loop transformations. To study something as basic as the
execution ordering of the iterations of a loop nest, we need to know-
about several ways of partially ordering integer vectors. The most
important concept in loop transformations, namely that of depen-
dence, can be viewed as a relation between the members of a certain
set. This set could be the set of iterations of a loop nest, or the
set of statements in the body of the nest, or the set of instances
of the statements. We can even go to a lower level and talk about
dependence between 'loads' and 'stores,' or to a higher level and
discuss dependence between large parts of a program.
The graphs that arise in the theory of loop transformations are
digraphs for the most part, although it is occasionally necessary to
consider the underlying undirected graph of a given directed graph.
Digraphs are very closely associated with relations; in fact, in this
book, we define a digraph simply as a nonempty set with a relation
in it. The geometric point of view of digraphs is naturally suited
to some situations and provides for a more intuitive description.
For example, it is beneficial to represent the dependence relation
between statements in a program as a digraph, and then use the
terms and results from graph theory in the decomposition of the
CHAPTER 1. RELATIONS AND DIGRAPHS
1.2 Relations
The Cartesian product, S x T, oi two sets S and T is the set of all
ordered pairs of the form (a, b) where a € 5 and b £ T. A relation
from a set S to a set T is any subset of S x T. A relation in a set S
is a subset of 5 x 5 . U R is a, relation in S and (a, b) E R, we write
aRb. The inverse of a relation R, denoted by R^^, is obtained by
reversing each of the pairs belonging to R, so that aR~^ b iS bRa.
Let R'^ denote the union and R^ the intersection of a collection of
relations {Rk : k E C} in S, where C is some nonempty index set.
Then a R^ b iS aR^b for some k in C, and aR' b iff aRkb for each
k in C. A relation R in a set S is