|
@ -1,5 +1,6 @@ |
|
|
#include <list>
|
|
|
#include <list>
|
|
|
#include <queue>
|
|
|
#include <queue>
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
#include "src/storage/MaximalEndComponentDecomposition.h"
|
|
|
#include "src/storage/MaximalEndComponentDecomposition.h"
|
|
|
#include "src/storage/StronglyConnectedComponentDecomposition.h"
|
|
|
#include "src/storage/StronglyConnectedComponentDecomposition.h"
|
|
@ -56,7 +57,7 @@ namespace storm { |
|
|
endComponentStateSets.emplace_back(subsystem.begin(), subsystem.end()); |
|
|
endComponentStateSets.emplace_back(subsystem.begin(), subsystem.end()); |
|
|
storm::storage::BitVector statesToCheck(model.getNumberOfStates()); |
|
|
storm::storage::BitVector statesToCheck(model.getNumberOfStates()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << " starting... " << std::endl; |
|
|
// The iterator used here should really be a const_iterator.
|
|
|
// The iterator used here should really be a const_iterator.
|
|
|
// However, gcc 4.8 (and assorted libraries) does not provide an erase(const_iterator) method for std::list
|
|
|
// However, gcc 4.8 (and assorted libraries) does not provide an erase(const_iterator) method for std::list
|
|
|
// but only an erase(iterator). This is in compliance with the c++11 draft N3337, which specifies the change
|
|
|
// but only an erase(iterator). This is in compliance with the c++11 draft N3337, which specifies the change
|
|
@ -69,7 +70,9 @@ 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.
|
|
|
|
|
|
std::cout << "boom" << std::endl; |
|
|
StronglyConnectedComponentDecomposition<ValueType> sccs(model, mec, true); |
|
|
StronglyConnectedComponentDecomposition<ValueType> sccs(model, mec, true); |
|
|
|
|
|
std::cout << "boom1" << std::endl; |
|
|
|
|
|
|
|
|
// 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.
|
|
@ -80,6 +83,7 @@ namespace storm { |
|
|
statesToCheck.set(scc.begin(), scc.end()); |
|
|
statesToCheck.set(scc.begin(), scc.end()); |
|
|
|
|
|
|
|
|
while (!statesToCheck.empty()) { |
|
|
while (!statesToCheck.empty()) { |
|
|
|
|
|
std::cout << "not empty!" << std::endl; |
|
|
storm::storage::BitVector statesToRemove(model.getNumberOfStates()); |
|
|
storm::storage::BitVector statesToRemove(model.getNumberOfStates()); |
|
|
|
|
|
|
|
|
for (auto state : statesToCheck) { |
|
|
for (auto state : statesToCheck) { |
|
@ -116,7 +120,7 @@ namespace storm { |
|
|
statesToCheck.clear(); |
|
|
statesToCheck.clear(); |
|
|
for (auto state : statesToRemove) { |
|
|
for (auto state : statesToRemove) { |
|
|
for (auto const& entry : backwardTransitions.getRow(state)) { |
|
|
for (auto const& entry : backwardTransitions.getRow(state)) { |
|
|
if (!scc.containsState(entry.getColumn())) { |
|
|
|
|
|
|
|
|
if (scc.containsState(entry.getColumn())) { |
|
|
statesToCheck.set(entry.getColumn()); |
|
|
statesToCheck.set(entry.getColumn()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -142,7 +146,9 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} // End of loop over all MEC candidates.
|
|
|
} // End of loop over all MEC candidates.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << " got here... " << std::endl; |
|
|
|
|
|
|
|
|
// Now that we computed the underlying state sets of the MECs, we need to properly identify the choices
|
|
|
// Now that we computed the underlying state sets of the MECs, we need to properly identify the choices
|
|
|
// contained in the MEC and store them as actual MECs.
|
|
|
// contained in the MEC and store them as actual MECs.
|
|
|
this->blocks.reserve(endComponentStateSets.size()); |
|
|
this->blocks.reserve(endComponentStateSets.size()); |
|
@ -154,7 +160,7 @@ namespace storm { |
|
|
for (uint_fast64_t choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { |
|
|
for (uint_fast64_t choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { |
|
|
bool choiceContained = true; |
|
|
bool choiceContained = true; |
|
|
for (auto const& entry : transitionMatrix.getRow(choice)) { |
|
|
for (auto const& entry : transitionMatrix.getRow(choice)) { |
|
|
if (mecStateSet.find(entry.getColumn()) == mecStateSet.end()) { |
|
|
|
|
|
|
|
|
if (!mecStateSet.containsState(entry.getColumn())) { |
|
|
choiceContained = false; |
|
|
choiceContained = false; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|