This commit is contained in:
parent
918f3f1a67
commit
b6e27e83d5
1 changed files with 8 additions and 4 deletions
|
@ -10,7 +10,7 @@ The system dependence graph (SDG) is a method for program slicing that was first
|
|||
proposed by Horwitz, Reps and Blinkey \cite{HorwitzRB88}. It builds upon the
|
||||
existing control flow graph (CFG), defining dependencies between vertices of the
|
||||
CFG, and building a program dependence graph (PDG), which represents them. The
|
||||
system dependence graph (SDG) is then build from the assembly of the different
|
||||
system dependence graph (SDG) is then \added{built}\deleted{build} from the assembly of the different
|
||||
PDGs (each representing a method of the program), linking each method call to
|
||||
its corresponding definition. Because each graph is built from the previous one,
|
||||
new constructs can be added with to the CFG, without the need to alter the
|
||||
|
@ -35,12 +35,14 @@ predicate.
|
|||
|
||||
\begin{definition}[Control Flow Graph~\cite{???}]
|
||||
A \emph{control flow graph} $G$ of a program $P$ is a tuple $\langle N, E \rangle$, where $N$ is a set of nodes, composed of a method's statements and two special nodes, ``Start'' and ``End''. $E$ is a set of edges of the form $e = \left(n_1, n_2\right)$ a directed edge from $n_1$ to $n_2$
|
||||
|
||||
\josep{solo has dicho la parte sintactica. Yo añadiría que existe un arco de el nodo $n_1$ al nodo $n_2$ si y solo si, en alguna ejecución, $n_2$ es ejecutado inmediatamente despues de $n_1$}
|
||||
\end{definition}
|
||||
|
||||
To build the PDG and then the SDG, some dependencies must be extracted from the CFG, which are defined as follows:
|
||||
|
||||
\begin{definition}[Postdominance]
|
||||
Vertex $b$ \textit{postdominates} vertex $b$ if and only if $a \neq b$ and $b$ is on every path from $a$ to the ``End'' vertex.
|
||||
Vertex $b$ \textit{postdominates} vertex \added{$a$}\deleted{$b$} if and only if $a \neq b$ and $b$ is on every path from $a$ to the ``End'' vertex.
|
||||
\end{definition}
|
||||
|
||||
\begin{definition}[Control dependency]
|
||||
|
@ -48,8 +50,10 @@ To build the PDG and then the SDG, some dependencies must be extracted from the
|
|||
Vertex $b$ is \textit{control dependent} on vertex $a$ ($a \ctrldep b$) if and only if $b$ postdominates one but not all of $a$'s successors. It follows that a vertex with only one successor cannot be the source of control dependence.
|
||||
\end{definition}
|
||||
|
||||
\josep{de donde has sacado esta definicion? La veo incorrecta. Por ejemplo, si tenemos $if ~a ~then ~b$, $b$ no postdomina ningun sucesor de $a$}
|
||||
|
||||
\begin{definition}[Data dependency]
|
||||
Vertex $b$ is \textit{data dependent} on vertex $a$ ($a \datadep b$) if and only if $a$ may define a variable $x$, $b$ may use $x$ and there an $x$-definition free path from $a$ to $b$.\footnote{The initial definition of data dependency was further split into in-loop data dependencies and the rest, but the difference is not relevant for computing the slices in the SDG.}
|
||||
Vertex $b$ is \textit{data dependent} on vertex $a$ ($a \datadep b$) if and only if $a$ may define a variable $x$, $b$ may use $x$ and there \added{exists} an $x$-definition free path from $a$ to $b$.\footnote{The initial definition of data dependency was further split into in-loop data dependencies and the rest, but the difference is not relevant for computing the slices in the SDG.}
|
||||
\end{definition}
|
||||
|
||||
It should be noted that variable definitions and uses can be computed for each
|
||||
|
@ -59,7 +63,7 @@ left-hand side of assignments. Similarly, no instruction defines variables,
|
|||
except those in the left-hand side of assignments. The variables used and
|
||||
defined by a procedure call are those used and defined by its body.
|
||||
|
||||
With the data and control dependencies, the PDG may be built, by replacing the
|
||||
With the data and control dependencies, the PDG may be built\deleted{,} by replacing the
|
||||
edges from the CFG by data and control dependence edges. The first tends to be
|
||||
represented as a thin solid line, and the latter as a thick solid line. In the
|
||||
examples, data dependencies will be thin solid red lines.
|
||||
|
|
Loading…
Reference in a new issue