Browse Source

Clean up

tempestpy_adaptions
Jip Spel 6 years ago
parent
commit
ee8971c608
  1. 9
      src/storm-pars/analysis/Lattice.cpp
  2. 9
      src/storm-pars/analysis/Lattice.h

9
src/storm-pars/analysis/Lattice.cpp

@ -180,9 +180,8 @@ namespace storm {
} }
out << "}" << std::endl; out << "}" << std::endl;
} }
bool Lattice::above(Node *node1, Node *node2) { bool Lattice::above(Node *node1, Node *node2) {
bool result = !node1->below.empty() && std::find(node1->below.begin(), node1->below.end(), node2) != node1->below.end(); bool result = !node1->below.empty() && std::find(node1->below.begin(), node1->below.end(), node2) != node1->below.end();
@ -191,11 +190,5 @@ namespace storm {
} }
return result; return result;
} }
void Lattice::setStates(std::vector<uint_fast64_t> states, Node *node) {
for (auto itr = states.begin(); itr < states.end(); ++itr) {
node->states.set(*itr);
}
}
} }
} }

9
src/storm-pars/analysis/Lattice.h

@ -150,17 +150,17 @@ namespace storm {
for (auto rowItr = row.begin(); rowItr != row.end(); ++rowItr) { for (auto rowItr = row.begin(); rowItr != row.end(); ++rowItr) {
stateMap[i].set(rowItr->getColumn(), true); stateMap[i].set(rowItr->getColumn(), true);
} }
// TODO: allow more than 2 transitions
// TODO: allow more than 2 transitions? or fix this in preprocessing?
STORM_LOG_THROW(stateMap[i].getNumberOfSetBits() <= 2, storm::exceptions::NotSupportedException, "Only two outgoing transitions per state allowed"); STORM_LOG_THROW(stateMap[i].getNumberOfSetBits() <= 2, storm::exceptions::NotSupportedException, "Only two outgoing transitions per state allowed");
} }
// Start creating the Lattice // Start creating the Lattice
storm::analysis::Lattice *lattice = new storm::analysis::Lattice(topStates, bottomStates, numberOfStates); storm::analysis::Lattice *lattice = new storm::analysis::Lattice(topStates, bottomStates, numberOfStates);
storm::storage::BitVector oldStates(numberOfStates); storm::storage::BitVector oldStates(numberOfStates);
// Create a copy of the states already present in the lattice. // Create a copy of the states already present in the lattice.
storm::storage::BitVector seenStates = topStates|= bottomStates; storm::storage::BitVector seenStates = topStates|= bottomStates;
matrix.printAsMatlabMatrix(std::cout);
while (oldStates != seenStates) { while (oldStates != seenStates) {
// As long as new states are added to the lattice, continue. // As long as new states are added to the lattice, continue.
oldStates = storm::storage::BitVector(seenStates); oldStates = storm::storage::BitVector(seenStates);
@ -181,7 +181,7 @@ namespace storm {
lattice->addToNode(stateNumber, lattice->getNode(successors.getNextSetIndex(0))); lattice->addToNode(stateNumber, lattice->getNode(successors.getNextSetIndex(0)));
seenStates.set(stateNumber); seenStates.set(stateNumber);
} else if (check && successors.getNumberOfSetBits() > 1) { } else if (check && successors.getNumberOfSetBits() > 1) {
// TODO: allow more than 2 transitions
// TODO: allow more than 2 transitions?
// Otherwise, check how the two states compare, and add if the comparison is possible. // Otherwise, check how the two states compare, and add if the comparison is possible.
uint_fast64_t successor1 = successors.getNextSetIndex(0); uint_fast64_t successor1 = successors.getNextSetIndex(0);
@ -220,9 +220,6 @@ namespace storm {
uint_fast64_t numberOfStates; uint_fast64_t numberOfStates;
bool above(Node *, Node *); bool above(Node *, Node *);
void setStates(std::vector<uint_fast64_t> states, Node *node);
}; };
} }
} }

Loading…
Cancel
Save