|
@ -80,7 +80,20 @@ namespace storm { |
|
|
endComponentStateSets.emplace_back(states.begin(), states.end(), true); |
|
|
endComponentStateSets.emplace_back(states.begin(), states.end(), true); |
|
|
} |
|
|
} |
|
|
storm::storage::BitVector statesToCheck(numberOfStates); |
|
|
storm::storage::BitVector statesToCheck(numberOfStates); |
|
|
|
|
|
|
|
|
|
|
|
storm::storage::BitVector includedChoices; |
|
|
|
|
|
if (choices) { |
|
|
|
|
|
includedChoices = *choices; |
|
|
|
|
|
} else if (states) { |
|
|
|
|
|
includedChoices = storm::storage::BitVector(transitionMatrix.getRowCount()); |
|
|
|
|
|
for (auto state : *states) { |
|
|
|
|
|
for (uint_fast64_t choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { |
|
|
|
|
|
includedChoices.set(choice, true); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
includedChoices = storm::storage::BitVector(transitionMatrix.getRowCount(), true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (std::list<StateBlock>::const_iterator mecIterator = endComponentStateSets.begin(); mecIterator != endComponentStateSets.end();) { |
|
|
for (std::list<StateBlock>::const_iterator mecIterator = endComponentStateSets.begin(); mecIterator != endComponentStateSets.end();) { |
|
|
StateBlock const& mec = *mecIterator; |
|
|
StateBlock const& mec = *mecIterator; |
|
|
|
|
|
|
|
@ -88,7 +101,7 @@ namespace storm { |
|
|
bool mecChanged = false; |
|
|
bool mecChanged = false; |
|
|
|
|
|
|
|
|
// Get an SCC decomposition of the current MEC candidate.
|
|
|
// Get an SCC decomposition of the current MEC candidate.
|
|
|
StronglyConnectedComponentDecomposition<ValueType> sccs(transitionMatrix, mec, true); |
|
|
|
|
|
|
|
|
StronglyConnectedComponentDecomposition<ValueType> sccs(transitionMatrix, mec, includedChoices, true); |
|
|
|
|
|
|
|
|
// We need to do another iteration in case we have either more than once SCC or the SCC is smaller than
|
|
|
// We need to do another iteration in case we have either more than once SCC or the SCC is smaller than
|
|
|
// the MEC canditate itself.
|
|
|
// the MEC canditate itself.
|
|
@ -105,10 +118,16 @@ namespace storm { |
|
|
bool keepStateInMEC = false; |
|
|
bool keepStateInMEC = false; |
|
|
|
|
|
|
|
|
for (uint_fast64_t choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { |
|
|
for (uint_fast64_t choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { |
|
|
|
|
|
|
|
|
// If the choice is not part of our subsystem, skip it.
|
|
|
// If the choice is not part of our subsystem, skip it.
|
|
|
if (choices && !choices->get(choice)) { |
|
|
if (choices && !choices->get(choice)) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If the choice is not included any more, skip it.
|
|
|
|
|
|
if (!includedChoices.get(choice)) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool choiceContainedInMEC = true; |
|
|
bool choiceContainedInMEC = true; |
|
|
for (auto const& entry : transitionMatrix.getRow(choice)) { |
|
|
for (auto const& entry : transitionMatrix.getRow(choice)) { |
|
@ -117,6 +136,7 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!scc.containsState(entry.getColumn())) { |
|
|
if (!scc.containsState(entry.getColumn())) { |
|
|
|
|
|
includedChoices.set(choice, false); |
|
|
choiceContainedInMEC = false; |
|
|
choiceContainedInMEC = false; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
@ -125,7 +145,6 @@ namespace storm { |
|
|
// If there is at least one choice whose successor states are fully contained in the MEC, we can leave the state in the MEC.
|
|
|
// If there is at least one choice whose successor states are fully contained in the MEC, we can leave the state in the MEC.
|
|
|
if (choiceContainedInMEC) { |
|
|
if (choiceContainedInMEC) { |
|
|
keepStateInMEC = true; |
|
|
keepStateInMEC = true; |
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -185,15 +204,7 @@ namespace storm { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool choiceContained = true; |
|
|
|
|
|
for (auto const& entry : transitionMatrix.getRow(choice)) { |
|
|
|
|
|
if (!mecStateSet.containsState(entry.getColumn())) { |
|
|
|
|
|
choiceContained = false; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (choiceContained) { |
|
|
|
|
|
|
|
|
if (includedChoices.get(choice)) { |
|
|
containedChoices.insert(choice); |
|
|
containedChoices.insert(choice); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|