#include "src/modelchecker/results/SymbolicQualitativeCheckResult.h" #include "src/utility/macros.h" #include "src/exceptions/InvalidOperationException.h" #include "src/exceptions/NotImplementedException.h" namespace storm { namespace modelchecker { template SymbolicQualitativeCheckResult::SymbolicQualitativeCheckResult(storm::dd::Bdd const& reachableStates, storm::dd::Bdd const& truthValues) : reachableStates(reachableStates), states(reachableStates), truthValues(truthValues) { // Intentionally left empty. } template bool SymbolicQualitativeCheckResult::isSymbolic() const { return true; } template bool SymbolicQualitativeCheckResult::isResultForAllStates() const { return reachableStates == states; } template bool SymbolicQualitativeCheckResult::isSymbolicQualitativeCheckResult() const { return true; } template QualitativeCheckResult& SymbolicQualitativeCheckResult::operator&=(QualitativeCheckResult const& other) { STORM_LOG_THROW(other.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException, "Cannot perform logical 'and' on check results of incompatible type."); this->truthValues &= other.asSymbolicQualitativeCheckResult().getTruthValuesVector(); return *this; } template QualitativeCheckResult& SymbolicQualitativeCheckResult::operator|=(QualitativeCheckResult const& other) { STORM_LOG_THROW(other.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException, "Cannot perform logical 'and' on check results of incompatible type."); this->truthValues |= other.asSymbolicQualitativeCheckResult().getTruthValuesVector(); return *this; } template void SymbolicQualitativeCheckResult::complement() { this->truthValues = !this->truthValues && reachableStates; } template storm::dd::Bdd const& SymbolicQualitativeCheckResult::getTruthValuesVector() const { return this->truthValues; } template bool SymbolicQualitativeCheckResult::existsTrue() const { return !this->truthValues.isZero(); } template bool SymbolicQualitativeCheckResult::forallTrue() const { return this->truthValues == this->states; } template uint64_t SymbolicQualitativeCheckResult::count() const { return this->truthValues.getNonZeroCount(); } template std::ostream& SymbolicQualitativeCheckResult::writeToStream(std::ostream& out) const { if (this->truthValues.isZero()) { out << "[false]" << std::endl; } else { out << "[true]" << std::endl; } return out; } template void SymbolicQualitativeCheckResult::filter(QualitativeCheckResult const& filter) { STORM_LOG_THROW(filter.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException, "Cannot filter symbolic check result with non-symbolic filter."); this->truthValues &= filter.asSymbolicQualitativeCheckResult().getTruthValuesVector(); this->states &= filter.asSymbolicQualitativeCheckResult().getTruthValuesVector(); } template class SymbolicQualitativeCheckResult; template class SymbolicQualitativeCheckResult; } }