(Last modified Thu Apr 17 22:42 2008)

home teaching site map schedule

ICS 215
Software Analysis and Testing
Spring 2008
Data flow exercise

Bring your work to class on the due date.  Class members will present parts of the analysis, and evaluate each other's work. dataflow example

Calculate gen[S], kill[S], in[S], and out[S] for all the compound statements of the program below.

/*d1*/ i = m-1;
/*d2*/ j = n;
/*d3*/ a = u1;
       do
/*d4*/   i = i+1;
/*d5*/   j = j+1;
         if e1 then
/*d6*/     a = u2;
         else
/*d7*/     i = u3;
       while e2;

Use these compound statements (and any others you find necessary):

Sequence S1
/*d1*/ i = m-1;
/*d2*/ j = n;
/*d3*/ a = u1;
Sequence S2
/*d4*/   i = i+1;
/*d5*/   j = j+1;
Alternation S3
         if e1 then
/*d6*/     a = u2;
         else
/*d7*/     i = u3;
Iteration S4
       do
         /* S2 */
/*d4*/   i = i+1;
/*d5*/   j = j+1;
         /* S3 */
         if e1 then
/*d6*/     a = u2;
         else
/*d7*/     i = u3;
       while e2;
Sequence S5 (the entire program)
       /* S1 */
/*d1*/ i = m-1;
/*d2*/ j = n;
/*d3*/ a = u1;
       /* S4 */
       do
         /* S2 */
/*d4*/   i = i+1;
/*d5*/   j = j+1;
         /* S3 */
         if e1 then
/*d6*/     a = u2;
         else
/*d7*/     i = u3;
       while e2;
Share-Alike Made with jEdit Valid CSS! Valid HTML 4.01! UC Irvine Thomas A. Alspaugh
Assistant Professor, Informatics Dept.
School of Information and Computer Sciences