Skip to content

Commit 5047b34

Browse files
committed
hopefully last issues with indexes...
1 parent 529eb06 commit 5047b34

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

pnmcc/fr.lip6.move.gal.application.pnmcc/src/fr/lip6/move/gal/application/solver/UpperBoundsSolver.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ public static List<Integer> applyReductions(MccTranslator reader, DoneProperties
266266

267267
printBounds("After Parikh guided walk", maxSeen, maxStruct);
268268
checkStatus(spn, tocheck, maxStruct, maxSeen, doneProps, "TOPOLOGICAL PARIKH_GUIDED_WALK");
269-
if (spn.getProperties().removeIf(p -> doneProps.containsKey(p.getName())))
270-
iter++;
271269
if (spn.getProperties().isEmpty())
272270
break;
273271

@@ -309,7 +307,9 @@ public static List<Integer> applyReductions(MccTranslator reader, DoneProperties
309307
spn.testInInitial();
310308
spn.removeConstantPlaces();
311309
spn.simplifyLogic();
312-
310+
311+
312+
313313
if (checkStatus(spn, tocheck, maxStruct, maxSeen, doneProps, "TOPOLOGICAL STRUCTURAL_REDUCTION") > 0) {
314314
printBounds("after structural reductions", maxSeen, maxStruct);
315315
iter++;
@@ -318,6 +318,15 @@ public static List<Integer> applyReductions(MccTranslator reader, DoneProperties
318318
return Collections.emptyList();
319319
}
320320

321+
if (spn.getProperties().size() != tocheck.size()) {
322+
System.out.println("Inconsistency detected : number of properties changed after reduction without any verdict. This should not happen.");
323+
} else {
324+
tocheck.clear();
325+
for (Property prop : spn.getProperties()) {
326+
tocheck.add(prop.getBody());
327+
}
328+
}
329+
321330
if (!isBounded.isPresent()) {
322331
// check if we still have inf upper bounds
323332
int hasInf = -1;
@@ -348,7 +357,7 @@ public static List<Integer> applyReductions(MccTranslator reader, DoneProperties
348357
long total = 10000; // 10 seconds
349358
while (System.currentTimeMillis() - start < total) {
350359
int[] verdicts = cw.runRandomReachabilityDetection(nbsteps, tocheck, (int) (total - (start - System.currentTimeMillis())) / 1000, -1, true, maxState);
351-
iter += interpretVerdict(tocheck, spn, doneProps, verdicts,"COVER",maxSeen,maxStruct);
360+
iter += interpretVerdict(tocheck, spn, doneProps, verdicts,"COVER", maxSeen, maxStruct);
352361
if (DEBUG >= 1) printBounds("after cover walk", maxSeen, maxStruct);
353362
if (maxSeen.size() == 0) {
354363
break;
@@ -466,9 +475,6 @@ private static void testWithReachability(MccTranslator ori, List<Integer> maxSee
466475
}
467476
}
468477
if (done) {
469-
ori.getSPN().getProperties().remove(id);
470-
maxSeen.remove(id);
471-
maxStruct.remove(id);
472478
seen++;
473479
}
474480
}
@@ -672,13 +678,11 @@ public static void approximateStructuralBoundsUsingInvariants(ISparsePetriNet sr
672678
}
673679

674680
public static void computeToCheck(SparsePetriNet spn, List<Expression> tocheck, DoneProperties doneProps) {
675-
int j=0;
676681
tocheck.clear();
677682
for (fr.lip6.move.gal.structural.Property p : spn.getProperties()) {
678683
if (! doneProps.containsKey(p.getName()) && p.getType() == PropertyType.BOUNDS) {
679684
tocheck.add(p.getBody());
680685
}
681-
j++;
682686
}
683687
}
684688

0 commit comments

Comments
 (0)