+ private boolean checkCurrentCGIsValid(IntChoiceFromSet icsCG, VM vm) {
+ // Check if the execution explored is from the last CG being reset
+ if (isEndOfExecution) {
+ if (currBacktrackCG != null && currBacktrackCG != icsCG) {
+ // If the reset CG isn't explored, try to explore another one
+ exploreNextBacktrackPoints(icsCG, vm);
+ return false;
+ } else {
+ int stateId = currBacktrackCG.getStateId();
+ LinkedList<Integer[]> backtrackChoices = backtrackMap.get(stateId);
+ backtrackChoices.removeLast();
+ // Remove from the queue if we don't have more backtrack points for that state
+ if (backtrackChoices.isEmpty()) {
+ cgMap.remove(stateId);
+ backtrackMap.remove(stateId);
+ backtrackStateQ.remove(stateId);
+ }
+ return true;
+ }
+ }
+ return true;
+ }
+