#include #include #include "DFTElements.h" namespace storm { namespace storage { template bool DFTElement::checkDontCareAnymore(storm::storage::DFTState& state, DFTStateSpaceGenerationQueues& queues) const { if (state.dontCare(mId)) { return false; } // Check that no outgoing dependencies can be triggered anymore for (DFTDependencyPointer dependency : mOutgoingDependencies) { if (state.isOperational(dependency->dependentEvent()->id()) && state.isOperational(dependency->triggerEvent()->id())) { return false; } } // Check that no parent can fail anymore for(DFTGatePointer const& parent : mParents) { if(state.isOperational(parent->id())) { return false; } } state.setDontCare(mId); return true; } template void DFTElement::extendSpareModule(std::set& elementsInModule) const { for(auto const& parent : mParents) { if(elementsInModule.count(parent->id()) == 0 && !parent->isSpareGate()) { elementsInModule.insert(parent->id()); parent->extendSpareModule(elementsInModule); } } } template std::vector DFTElement::independentUnit() const { std::vector res; res.push_back(this->id()); // Extend for pdeps. return res; } template void DFTElement::extendUnit(std::set& unit) const { unit.insert(mId); } template std::vector DFTElement::independentSubDft() const { //std::cout << "INDEPENDENT SUBTREE CALL " << this->id() << std::endl; std::vector res; res.push_back(this->id()); return res; } template void DFTElement::extendSubDft(std::set& elemsInSubtree, std::vector const& parentsOfSubRoot) const { if(elemsInSubtree.count(this->id()) > 0) return; if(std::find(parentsOfSubRoot.begin(), parentsOfSubRoot.end(), mId) != parentsOfSubRoot.end()) { // This is a parent of the suspected root, thus it is not a subdft. elemsInSubtree.clear(); return; } elemsInSubtree.insert(mId); for(auto const& parent : mParents) { parent->extendSubDft(elemsInSubtree, parentsOfSubRoot); if(elemsInSubtree.empty()) { return; } } for(auto const& dep : mOutgoingDependencies) { dep->extendSubDft(elemsInSubtree, parentsOfSubRoot); if(elemsInSubtree.empty()) { return; } } } template bool DFTBE::checkDontCareAnymore(storm::storage::DFTState& state, DFTStateSpaceGenerationQueues& queues) const { if(DFTElement::checkDontCareAnymore(state, queues)) { state.beNoLongerFailable(this->mId); return true; } return false; } // Explicitly instantiate the class. template class DFTBE; #ifdef STORM_HAVE_CARL template class DFTBE; #endif } }