Skip to content

Commit

Permalink
#295, bugfixes, simplest example does not crash anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernutz committed Jan 26, 2018
1 parent 580494a commit 9afa430
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ protected void convert(final Term term) {
* TODO: indeed for this field it might be nicer to use Map<ArrayCellAccess, List<LocationBlock>>
* instead of a NestedMap2...
*/
locationBlockList.add(mArrayCellAccessToIntegerToLocationBlock.get(aca, dim));
final LocationBlock locationBlock = mArrayCellAccessToIntegerToLocationBlock.get(aca, dim);
assert locationBlock != null;
locationBlockList.add(locationBlock);
}
enqueueWalker(new EndScope());
pushTerm(aca.getArray());
Expand Down Expand Up @@ -336,9 +338,11 @@ private Term extractSimpleArrayTerm(final Term term) {
throw new IllegalArgumentException();
}
Term currentTerm = term;
while (SmtUtils.isFunctionApplication(currentTerm, "store")) {
while (SmtUtils.isFunctionApplication(currentTerm, "store")
|| SmtUtils.isFunctionApplication(currentTerm, "select")) {
currentTerm = ((ApplicationTerm) currentTerm).getParameters()[0];
}
assert !(currentTerm instanceof ApplicationTerm) || ((ApplicationTerm) currentTerm).getParameters().length == 0;
return currentTerm;
}

Expand Down Expand Up @@ -426,7 +430,7 @@ private ArrayGroup getArrayGroup(final Term term) {

private static <E> List<E> dropFirst(final List<E> projectList) {
final List<E> newList = new ArrayList<>();
newList.addAll(projectList.subList(1, projectList.size() - 1));
newList.addAll(projectList.subList(1, projectList.size()));
return Collections.unmodifiableList(newList);
}

Expand Down

0 comments on commit 9afa430

Please sign in to comment.