Opened 16 years ago
Closed 16 years ago
#115 closed defect (fixed)
Laplace test errors
| Reported by: | Stephen Siegel | Owned by: | zirkel |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | front | Version: | 1.0 |
| Keywords: | Cc: |
Description
Laplace tests have syntax exception.
Change History (7)
comment:1 by , 16 years ago
| Component: | test → front |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 16 years ago
| Status: | assigned → accepted |
|---|
comment:3 by , 16 years ago
Bug fixed. The example can now be parsed correctly. But I am getting an execution error as follows:
Exception in thread "main" edu.udel.cis.vsl.minimp.util.ExecutionException: Execution error encountered at laplaceImpl.mmp 29.8--29.12: "nxlg"
Cannot prove that extent 1 of array is nonnegative
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.dimensions(Executor.java:774)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.arrayValueType(Executor.java:791)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.dynamicType(Executor.java:723)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.initializeVariable(Executor.java:548)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.initialize(Executor.java:604)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.initialize(Executor.java:615)
at edu.udel.cis.vsl.minimp.verify.std.StateManager.initialState(StateManager.java:49)
at edu.udel.cis.vsl.minimp.verify.Verification.verify(Verification.java:117)
at edu.udel.cis.vsl.minimp.MiniMP.verify(MiniMP.java:388)
at edu.udel.cis.vsl.minimp.MiniMP.main(MiniMP.java:505)
I think the reason is that the input variables nxlg and nylg are explicitly initialized, but input variables can not be written to.
comment:4 by , 16 years ago
I changed the input variables as follows:
input int nxlg {nxlg == 10};
input int nylg {nylg == 4};
And the program can verify that the extents of arrays are all non-negative. But I got another exception:
edu.udel.cis.vsl.minimp.util.ExecutionException: Execution error encountered at laplaceImpl.mmp 148.6--148.32: "grid[(new+1)%2][row][col] ="
Possible array out of bounds error:
array expression = grid[(new+1)%2][row]
index expression = col
index value = 4
array extent = X5
query = (4<X5)
path condition = ((X5==4)&&((X4==10)&&((0<X2)&&((0<X1)&&(0<X0)))))
at edu.udel.cis.vsl.minimp.semantics.impl.Evaluator.arrayElementReferenceValue(Evaluator.java:172)
at edu.udel.cis.vsl.minimp.semantics.impl.Evaluator.referenceValue(Evaluator.java:222)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.assignValue(Executor.java:236)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.executeAssignment(Executor.java:243)
at edu.udel.cis.vsl.minimp.semantics.impl.Executor.execute(Executor.java:99)
at edu.udel.cis.vsl.minimp.verify.std.StateManager.nextState(StateManager.java:74)
at edu.udel.cis.vsl.minimp.verify.std.StateManager.nextState(StateManager.java:1)
at edu.udel.cis.vsl.minimp.search.DfsSearcher.proceedToNewState(DfsSearcher.java:141)
at edu.udel.cis.vsl.minimp.search.DfsSearcher.search(DfsSearcher.java:102)
at edu.udel.cis.vsl.minimp.search.DfsSearcher.search(DfsSearcher.java:88)
at edu.udel.cis.vsl.minimp.verify.Verification.verify(Verification.java:133)
at edu.udel.cis.vsl.minimp.MiniMP.verify(MiniMP.java:388)
at edu.udel.cis.vsl.minimp.MiniMP.main(MiniMP.java:505)
It looks like the while loop, from line 145 - 153 in laplaceImpl.mmp, had incorrect array upper bounds:
while (row < nylg) {
col = 0;
while (col < nxlg) {
grid[(new+1)%2][row][col] = 0.0;
grid[new][row][col] = 0.0;
col = col + 1;
}
row = row + 1;
}
I think the outer loop should have "row < nxlg" and inner loop should have "col < nxlg" since the definition of the array grid is "real[2][nxlg][nylg]" and the loop used grid[new][row][col] to get the element.
comment:5 by , 16 years ago
| Owner: | changed from to |
|---|---|
| Status: | accepted → assigned |
comment:6 by , 16 years ago
| Status: | assigned → accepted |
|---|
comment:7 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |

Here's the syntax error. The exit location for a branch location is not being set by the model builder.
void sendrecv(real[] sendbuf, int dest, int sendtag, real[] recvbuf, int source, int recvtag) { if (source != -1 && dest != -1){ select when (true) {send(sendbuf, dest, sendtag); recv(recvbuf, source, recvtag);} when (true) {recv(recvbuf, source, recvtag); send(sendbuf, dest, sendtag);} } else { /* either source or dest is invalid */ if (source != -1) { recv(recvbuf, source, recvtag); } if (dest != -1) { send(sendbuf, dest, sendtag); } } }