You are on page 1of 5

Corrective maintenance :

package com.company;
import java.lang.* ;
import java.util.Scanner;
public class Main {
1- public static void main(String[] args) {
2- Scanner s = new Scanner(System.in);
3- int[][] A = new int[5][5];
4- int I ,J ;
5- I = 1;
6- while (I<=5){
7- J=1;
8- while (J<=5){
9- A[I][J] = s.nextInt();
10- J=J+1;
}
11- I=I+1;
}
12- int Sum = SumM(A,5,5);
13- System.out.println(Sum);
}
14- private static int SumM(int Mt[][], int N, int M){
15- int sum ;
16- int I , J ;
17- sum = 0 ;
18- I=1;
19- while(I<=N){
20- J=1 ;
21- while (J<=1) {
22- sum = sum + Mt[I][J];
23- J=J+1;
}
24- I=I+1 ;
}
25- return sum ;
}
}

- 1- No comment
2- Fixed size of array

- Set a comment
Graphs:
Research Work :

Program Dependence Graph


In computer science, a program dependence graph (PDG) is a representation, using graph
notation that makes data dependencies and control dependencies explicit. These dependencies
are used during dependence analysis in optimizing compilers to make transformations so that
multiple cores are used, and parallelism is improved.

And that provides a unifying framework in which previous work in program optimization may
be applied. We present a new incremental data flow algorithm that operates directly on the
PDG.

The problem of the research


We present an intermediate program representation, called the program dependence graph
(PDG), that makes explicit both the data and control dependences for each operation in a
program. Data dependences have been used to represent only the relevant data flow
relationships of a program. Control dependences are introduced to analogously represent only
the essential control flow relationships of a program. Control dependences are derived from
the usual control flow graph. Many traditional optimizations operate more efficiently on the
PDG. Since dependences in the PDG connect computationally related parts of the program, a
single walk of these dependences is sufficient to perform many optimizations. The PDG allows
transformations such as vectorization that previously required special treatment of control
dependence, to be performed in a manner that is uniform for both control and data
dependences. Program transformations that require interaction of the two dependence types
can also be easily handled with our representation. As an example, an incremental approach to
modifying data dependences resulting from branch deletion or loop unrolling is introduced. The
PDG supports incremental optimization, permitting transformations to be triggered by one
another and applied only to affected dependences.

Objectives and approaches


Several approaches have been proposed for program comprehension and in the last few years
there has been a considerable effort to automate the same. The most important techniques
include program slicing (Horwitz and Reps 1992), cliché recognition (Wills 1994), and pattern
matching (Paul and Prakash 1994), besides the more conventional approaches of lexical and
syntactic analysis. Slicing is a data flow analysis derivative that helps understand what an
existing program does and how it works by reducing the available code to only those lines that
manipulate a certain set of program points of interest (e.g., input and output variables and their
dependants) .

Their main concepts

Their Supporting tools


The Program Dependence Graph The PDG represents a program as a graph in which the nodes
are statements and predicate expressions (or operators and operands) and the edges incident
to a node represent both the data values on which the node’s operations depend and the
control conditions on which the execution of the operations depends. Nodes representing
statements and predicates are sufficient for some transformations such as vectorization and
simplify our illustrations in this paper. For almost all other optimizing transformations, nodes
represent operators and operands. The set of all dependencies for a program may be viewed as
inducing a partial ordering on the statements and predicates in the program that must be
followed to preserve the semantics of the original program. Dependencies arise as the result of
two separate effects. First, a dependence exists between two statements whenever a variable
appearing in one statement may have an incorrect value if the two statements are reversed.
Control Dependence In this section, we define control dependence in terms of a control flow
graph and dominators [1, 3]. The Appendix contains the basic graph theoretic terminology
used.

Comparison
There are no differences .

Perspectives
 The Use Of Program Dependence Graphs In Software Engineering
 Automated software installers: They walk the graph looking for software packages that
are required but not yet installed. The dependency is given by the coupling of the
packages.
 In compiler technology and formal language implementation.
 Web Forms standards such as XForms to know what visual elements to update if data in
the model changes.

References
- Program dependence graph – Wikipedia
- Program dependence graph - Book

You might also like