Value Lattice & Static Analysis       
by William Brew and Maggie Johnson

Example 1:

int foo() {
   int x,y,z;
   x=12;
   y=17;
   ...     // a series assignments to x and y
           // no assignments are made to z
   if (y>x)
           x=1;
   else
           x=3;
   if (x>2)
           z=0;
   return z;
}


Example 2:

int foo(int x, int y){
   int z;
   if (x==y) {
       z=0;
   }
   return bar(z);
}
int bar (int z){
   z++;
   return z;
}
main(){
   inti,j;
   int w;
   for (i==0; i < 10; i++){
      for (j==0; j < 5; j++){
          w=foo(i,j);
          ...
      }
   }
}









1

