26 "The given number of labels does not match the number of choices.");
30 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices = transitionMatrix.
getRowGroupIndices();
34 std::vector<storm::storage::FlatSet<uint_fast64_t>> analysisInformation(model.
getNumberOfStates(), relevantLabels);
36 std::queue<uint_fast64_t> worklist;
41 for (
auto state : psiStates) {
43 for (
auto const& predecessorEntry : backwardTransitions.
getRow(state)) {
44 if (predecessorEntry.getColumn() != state && !statesInWorkList.
get(predecessorEntry.getColumn()) && !psiStates.
get(predecessorEntry.getColumn())) {
45 worklist.push(predecessorEntry.getColumn());
46 statesInWorkList.
set(predecessorEntry.getColumn());
47 markedStates.
set(state);
52 while (!worklist.empty()) {
53 uint_fast64_t
const& currentState = worklist.front();
55 size_t analysisInformationSizeBefore = analysisInformation[currentState].size();
58 for (uint_fast64_t currentChoice = nondeterministicChoiceIndices[currentState]; currentChoice < nondeterministicChoiceIndices[currentState + 1];
60 bool modifiedChoice =
false;
62 for (
auto const& entry : transitionMatrix.
getRow(currentChoice)) {
63 if (markedStates.
get(entry.getColumn())) {
64 modifiedChoice =
true;
73 for (
auto const& entry : transitionMatrix.
getRow(currentChoice)) {
74 if (markedStates.
get(entry.getColumn())) {
76 std::set_intersection(analysisInformation[currentState].begin(), analysisInformation[currentState].end(),
77 analysisInformation[entry.getColumn()].begin(), analysisInformation[entry.getColumn()].end(),
78 std::inserter(tmpIntersection, tmpIntersection.begin()));
79 std::set_intersection(analysisInformation[currentState].begin(), analysisInformation[currentState].end(),
80 labelSets[currentChoice].begin(), labelSets[currentChoice].end(),
81 std::inserter(tmpIntersection, tmpIntersection.begin()));
82 analysisInformation[currentState] = std::move(tmpIntersection);
90 if (analysisInformation[currentState].size() != analysisInformationSizeBefore) {
91 for (
auto const& predecessorEntry : backwardTransitions.
getRow(currentState)) {
93 if (!psiStates.
get(predecessorEntry.getColumn()) && !statesInWorkList.
get(predecessorEntry.getColumn())) {
94 worklist.push(predecessorEntry.getColumn());
95 statesInWorkList.
set(predecessorEntry.getColumn());
98 markedStates.
set(currentState,
true);
100 markedStates.
set(currentState,
false);
104 statesInWorkList.
set(currentState,
false);
107 return analysisInformation;
122 std::vector<storm::storage::FlatSet<uint_fast64_t>> guaranteedLabels =
getGuaranteedLabelSets(model, labelSets, psiStates, relevantLabels);
127 std::set_intersection(knownLabels.begin(), knownLabels.end(), guaranteedLabels[initialState].begin(), guaranteedLabels[initialState].end(),
128 std::inserter(tempIntersection, tempIntersection.end()));
129 std::swap(knownLabels, tempIntersection);
std::vector< storm::storage::FlatSet< uint_fast64_t > > getGuaranteedLabelSets(storm::models::sparse::Model< T > const &model, std::vector< storm::storage::FlatSet< uint_fast64_t > > const &labelSets, storm::storage::BitVector const &psiStates, storm::storage::FlatSet< uint_fast64_t > const &relevantLabels)
Computes a set of labels that is executed along all paths from any state to a target state.
storm::storage::FlatSet< uint_fast64_t > getGuaranteedLabelSet(storm::models::sparse::Model< T > const &model, std::vector< storm::storage::FlatSet< uint_fast64_t > > const &labelSets, storm::storage::BitVector const &psiStates, storm::storage::FlatSet< uint_fast64_t > const &relevantLabels)
Computes a set of labels that is executed along all paths from an initial state to a target state.
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.