X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2Fmain%2Fgov%2Fnasa%2Fjpf%2Flistener%2FDPORStateReducer.java;h=26dd6bd0b274f2b4fc6e6b963f0176fc224ca545;hb=c540b2eddfd5b18a25070d2f85bfe94de3f535c5;hp=104af2bd9993dd0cabb776e3e793e1a2060ba2fa;hpb=3e0a2fe1baa5e2530e75452524afdedba8045126;p=jpf-core.git diff --git a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java index 104af2b..26dd6bd 100644 --- a/src/main/gov/nasa/jpf/listener/DPORStateReducer.java +++ b/src/main/gov/nasa/jpf/listener/DPORStateReducer.java @@ -404,10 +404,6 @@ public class DPORStateReducer extends ListenerAdapter { // Store restorable state object for this state (always store the latest) RestorableVMState restorableState = vm.getRestorableState(); restorableStateMap.put(stateId, restorableState); - // Map multiple state IDs to a choice counter - for (Integer stId : justVisitedStates) { - stateToChoiceCounterMap.put(stId, choiceCounter); - } } private Integer[] copyChoices(Integer[] choicesToCopy) { @@ -495,6 +491,7 @@ public class DPORStateReducer extends ListenerAdapter { HashSet eventSet = new HashSet<>(); stateToEventMap.put(stateId, eventSet); } + stateToChoiceCounterMap.put(stateId, choiceCounter); analyzeReachabilityAndCreateBacktrackPoints(search.getVM(), stateId); justVisitedStates.add(stateId); currVisitedStates.add(stateId); @@ -588,6 +585,10 @@ public class DPORStateReducer extends ListenerAdapter { if (currentCG instanceof IntIntervalGenerator) { // This is the interval CG used in device handlers ChoiceGenerator parentCG = ((IntIntervalGenerator) currentCG).getPreviousChoiceGenerator(); + // Iterate until we find the IntChoiceFromSet CG + while (!(parentCG instanceof IntChoiceFromSet)) { + parentCG = ((IntIntervalGenerator) parentCG).getPreviousChoiceGenerator(); + } int actualEvtNum = ((IntChoiceFromSet) parentCG).getNextChoice(); // Find the index of the event/choice in refChoices for (int i = 0; i 1 && currVisitedStates.contains(stateId) && (stateId > 0)) { // Find the choice/event that marks the start of this cycle: first choice we explore for conflicts + if (stateToChoiceCounterMap.get(stateId) == null) { + System.out.println(); + } int conflictChoice = stateToChoiceCounterMap.get(stateId); int currentChoice = choiceCounter - 1; // Find conflicts between choices/events in this cycle (we scan forward in the cycle, not backward)