Opened 17 years ago

Closed 17 years ago

#79 closed defect (fixed)

for loop problem

Reported by: Stephen Siegel Owned by:
Priority: major Milestone:
Component: front Version: 1.0
Keywords: matrix multiplication, for Cc:

Description

I changed the first while loop in the matrixMultiplication examples to a for loop and got an unreachable location exception (again on a location with no source information, so difficult to debug). Here is code which I called mms2.mmp. I just ran

tass verify mms2.mmp

input int N {N>=0 && N<=2};
input real[N][N] A;
input real[N][N] B;
output real[N][N] C;

void main() {
  int i; 
  int j;
  int k;
  real[N][N] D;

  for (i = 0; i < N; i=i+1) {
    j = 0;
    while (j < N) {
      D[i][j] = 0.0;
      j = j + 1;
    }
  }
  i = 0;
  while (i < N) {
    j = 0;
    while (j < N) {
      k = 0;
      while (k < N) {
        D[i][j] = D[i][j] + A[i][k] * B[k][j]; 
        k = k + 1;
      }
      j  = j + 1;
    }
    i = i + 1;
  }
  i = 0;
  while (i < N) {
    j = 0;
    while (j < N) {
      C[i][j] = D[i][j];
      j = j + 1;
    }
    i = i + 1;
  }
}
frederic:matrixMultiplication siegel$ tass verify mms2.mmp
+----------------------------------------------------------------------+
|           TASS: Toolkit for Accurate Scientific Software             |
|  version 1.0.r1067 (2009-09-03)        http://vsl.cis.udel.edu/tass  |
+----------------------------------------------------------------------+
                   command            : verify
                   model              : mms2.mmp(np=1)
                   Deadlock detection : absolute
                   Reduction          : standard
                   verbose:           : No
                   simplify:          : No
                   bufferBound        : 10
                   use loop technique : false

Exception in thread "main" edu.udel.cis.vsl.minimp.model.IF.SyntaxException: Syntax error in null:
null[0]
Unreachable location
	at edu.udel.cis.vsl.minimp.model.impl.Function.complete(Function.java:339)
	at edu.udel.cis.vsl.minimp.model.impl.Process.complete(Process.java:122)
	at edu.udel.cis.vsl.minimp.model.impl.Model.complete(Model.java:141)
	at edu.udel.cis.vsl.minimp.front.minimp.ModelBuilder.processAST(ModelBuilder.java:274)
	at edu.udel.cis.vsl.minimp.front.minimp.ModelBuilder.buildModel(ModelBuilder.java:261)
	at edu.udel.cis.vsl.minimp.Minimp.verify(Minimp.java:427)
	at edu.udel.cis.vsl.minimp.Minimp.main(Minimp.java:535)
frederic:matrixMultiplication siegel$ 

Change History (1)

comment:1 by ywei, 17 years ago

Resolution: fixed
Status: newclosed

Fixed.

Note: See TracTickets for help on using tickets.