diff --git a/prism/src/param/StateEliminator.java b/prism/src/param/StateEliminator.java index 3a02b16d..ee8a2e3e 100644 --- a/prism/src/param/StateEliminator.java +++ b/prism/src/param/StateEliminator.java @@ -124,10 +124,23 @@ final class StateEliminator { * Orders states so that states near target states are eliminated first. * States which do not reach target states are eliminated last. In case * there are no target states, the order is arbitrary + */ + private int[] collectStatesBackward() + { + return collectStatesBackward(false); + } + + /** + * Orders states so that states near target states are eliminated first. + * States which do not reach target states are eliminated last. In case + * there are no target states, the order is arbitrary + *
+ * If {@code onlyStatesReachingTarget} is true, only the states that + * can reach the target states will be returned. * * @return list of states in requested order */ - private int[] collectStatesBackward() + private int[] collectStatesBackward(boolean onlyStatesReachingTarget) { int[] states = new int[pmc.getNumStates()]; BitSet seen = new BitSet(pmc.getNumStates()); @@ -155,7 +168,11 @@ final class StateEliminator { } current = next; } - + + if (onlyStatesReachingTarget) { + return states; + } + /* might not find all states when doing as above, * so add missing ones */ HashSet allStates = new HashSet();