Module 17: Loops
  Lecture 34: Symbolic Analysis
 


Multiple Loop Limits

  • Lower limit is the maximum of several expressions
  • Upper limit is the minimum of several expressions
for i = 1 to 8
for j = max(i-3,1), min(i,5)
A[i+1,,j+1] = A[i,,j] + B[i,,j]
endfor
endfor

Normalization gives:

end for
endfor

with dependence equations:

Exit in The Middle of a Loop

Some statements may execute more number of times than others

1.
2.
3.
4.
5.
6.
7.
j = 0
loop
j = j + 1
A[j] =···
if j > 10 then exit
= A[j+1]
endloop

line number 4 executes eleven times, therefore,