TimQu
8 years ago
11 changed files with 306 additions and 79 deletions
-
4src/storm/modelchecker/multiobjective/pcaa/SparsePcaaParetoQuery.cpp
-
30src/storm/modelchecker/prctl/HybridMdpPrctlModelChecker.cpp
-
63src/storm/modelchecker/results/CheckResult.cpp
-
35src/storm/modelchecker/results/CheckResult.h
-
58src/storm/modelchecker/results/ExplicitParetoCurveCheckResult.cpp
-
39src/storm/modelchecker/results/ExplicitParetoCurveCheckResult.h
-
30src/storm/modelchecker/results/ParetoCurveCheckResult.cpp
-
26src/storm/modelchecker/results/ParetoCurveCheckResult.h
-
57src/storm/modelchecker/results/SymbolicParetoCurveCheckResult.cpp
-
41src/storm/modelchecker/results/SymbolicParetoCurveCheckResult.h
-
2src/storm/solver/SolverSelectionOptions.cpp
@ -0,0 +1,58 @@ |
|||
|
|||
#include "storm/modelchecker/results/ExplicitParetoCurveCheckResult.h"
|
|||
|
|||
#include "storm/adapters/CarlAdapter.h"
|
|||
#include "storm/modelchecker/results/ExplicitQualitativeCheckResult.h"
|
|||
#include "storm/utility/macros.h"
|
|||
#include "storm/utility/vector.h"
|
|||
|
|||
#include "storm/exceptions/InvalidOperationException.h"
|
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
template<typename ValueType> |
|||
ExplicitParetoCurveCheckResult<ValueType>::ExplicitParetoCurveCheckResult() { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ExplicitParetoCurveCheckResult<ValueType>::ExplicitParetoCurveCheckResult(storm::storage::sparse::state_type const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type> const& points, typename ParetoCurveCheckResult<ValueType>::polytope_type const& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type const& overApproximation) : ParetoCurveCheckResult<ValueType>(points, underApproximation, overApproximation), state(state) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ExplicitParetoCurveCheckResult<ValueType>::ExplicitParetoCurveCheckResult(storm::storage::sparse::state_type const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type>&& points, typename ParetoCurveCheckResult<ValueType>::polytope_type&& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type&& overApproximation) : ParetoCurveCheckResult<ValueType>(points, underApproximation, overApproximation), state(state) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitParetoCurveCheckResult<ValueType>::isExplicitParetoCurveCheckResult() const { |
|||
return true; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitParetoCurveCheckResult<ValueType>::isExplicit() const { |
|||
return true; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void ExplicitParetoCurveCheckResult<ValueType>::filter(QualitativeCheckResult const& filter) { |
|||
STORM_LOG_THROW(filter.isExplicitQualitativeCheckResult(), storm::exceptions::InvalidOperationException, "Cannot filter explicit check result with non-explicit filter."); |
|||
STORM_LOG_THROW(filter.isResultForAllStates(), storm::exceptions::InvalidOperationException, "Cannot filter check result with non-complete filter."); |
|||
ExplicitQualitativeCheckResult const& explicitFilter = filter.asExplicitQualitativeCheckResult(); |
|||
ExplicitQualitativeCheckResult::vector_type const& filterTruthValues = explicitFilter.getTruthValuesVector(); |
|||
|
|||
STORM_LOG_THROW(filterTruthValues.getNumberOfSetBits() == 1 && filterTruthValues.get(state), storm::exceptions::InvalidOperationException, "The check result fails to contain some results referred to by the filter."); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
storm::storage::sparse::state_type const& ExplicitParetoCurveCheckResult<ValueType>:: getState() const { |
|||
return state; |
|||
} |
|||
|
|||
template class ExplicitParetoCurveCheckResult<double>; |
|||
#ifdef STORM_HAVE_CARL
|
|||
template class ExplicitParetoCurveCheckResult<storm::RationalNumber>; |
|||
#endif
|
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
#ifndef STORM_MODELCHECKER_EXPLICITPARETOCURVECHECKRESULT_H_ |
|||
#define STORM_MODELCHECKER_EXPLICITPARETOCURVECHECKRESULT_H_ |
|||
|
|||
#include <vector> |
|||
|
|||
#include "storm/modelchecker/results/ParetoCurveCheckResult.h" |
|||
#include "storm/storage/sparse/StateType.h" |
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
template<typename ValueType> |
|||
class ExplicitParetoCurveCheckResult : public ParetoCurveCheckResult<ValueType> { |
|||
public: |
|||
|
|||
ExplicitParetoCurveCheckResult(); |
|||
ExplicitParetoCurveCheckResult(storm::storage::sparse::state_type const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type> const& points, typename ParetoCurveCheckResult<ValueType>::polytope_type const& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type const& overApproximation); |
|||
ExplicitParetoCurveCheckResult(storm::storage::sparse::state_type const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type>&& points, typename ParetoCurveCheckResult<ValueType>::polytope_type&& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type&& overApproximation); |
|||
|
|||
ExplicitParetoCurveCheckResult(ExplicitParetoCurveCheckResult const& other) = default; |
|||
ExplicitParetoCurveCheckResult& operator=(ExplicitParetoCurveCheckResult const& other) = default; |
|||
ExplicitParetoCurveCheckResult(ExplicitParetoCurveCheckResult&& other) = default; |
|||
ExplicitParetoCurveCheckResult& operator=(ExplicitParetoCurveCheckResult&& other) = default; |
|||
virtual ~ExplicitParetoCurveCheckResult() = default; |
|||
|
|||
virtual bool isExplicitParetoCurveCheckResult() const override; |
|||
virtual bool isExplicit() const override; |
|||
|
|||
virtual void filter(QualitativeCheckResult const& filter) override; |
|||
|
|||
storm::storage::sparse::state_type const& getState() const; |
|||
|
|||
private: |
|||
// The state of the checked model to which the result applies |
|||
storm::storage::sparse::state_type state; |
|||
}; |
|||
} |
|||
} |
|||
|
|||
#endif /* STORM_MODELCHECKER_EXPLICITPARETOCURVECHECKRESULT_H_ */ |
@ -0,0 +1,57 @@ |
|||
|
|||
#include "storm/modelchecker/results/SymbolicParetoCurveCheckResult.h"
|
|||
|
|||
#include "storm/adapters/CarlAdapter.h"
|
|||
#include "storm/modelchecker/results/SymbolicQualitativeCheckResult.h"
|
|||
#include "storm/utility/macros.h"
|
|||
#include "storm/storage/dd/DdManager.h"
|
|||
|
|||
#include "storm/exceptions/InvalidOperationException.h"
|
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
SymbolicParetoCurveCheckResult<Type, ValueType>::SymbolicParetoCurveCheckResult() { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
SymbolicParetoCurveCheckResult<Type, ValueType>::SymbolicParetoCurveCheckResult(storm::dd::Bdd<Type> const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type> const& points, typename ParetoCurveCheckResult<ValueType>::polytope_type const& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type const& overApproximation) : ParetoCurveCheckResult<ValueType>(points, underApproximation, overApproximation), state(state) { |
|||
STORM_LOG_THROW(this->state.getNonZeroCount() == 1, storm::exceptions::InvalidOperationException, "ParetoCheckResults are only relevant for a single state."); |
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
SymbolicParetoCurveCheckResult<Type, ValueType>::SymbolicParetoCurveCheckResult(storm::dd::Bdd<Type> const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type>&& points, typename ParetoCurveCheckResult<ValueType>::polytope_type&& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type&& overApproximation) : ParetoCurveCheckResult<ValueType>(points, underApproximation, overApproximation), state(state) { |
|||
STORM_LOG_THROW(this->state.getNonZeroCount() == 1, storm::exceptions::InvalidOperationException, "ParetoCheckResults are only relevant for a single state."); |
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
bool SymbolicParetoCurveCheckResult<Type, ValueType>::isSymbolicParetoCurveCheckResult() const { |
|||
return true; |
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
bool SymbolicParetoCurveCheckResult<Type, ValueType>::isSymbolic() const { |
|||
return true; |
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
void SymbolicParetoCurveCheckResult<Type, ValueType>::filter(QualitativeCheckResult const& filter) { |
|||
STORM_LOG_THROW(filter.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException, "Cannot filter Symbolic check result with non-Symbolic filter."); |
|||
STORM_LOG_THROW(filter.isResultForAllStates(), storm::exceptions::InvalidOperationException, "Cannot filter check result with non-complete filter."); |
|||
SymbolicQualitativeCheckResult<Type> const& symbolicFilter = filter.template asSymbolicQualitativeCheckResult<Type>(); |
|||
|
|||
storm::dd::Bdd<Type> const& filterTruthValues = symbolicFilter.getTruthValuesVector(); |
|||
|
|||
STORM_LOG_THROW(filterTruthValues.getNonZeroCount() == 1 && !(filterTruthValues && state).isZero(), storm::exceptions::InvalidOperationException, "The check result fails to contain some results referred to by the filter."); |
|||
} |
|||
|
|||
template<storm::dd::DdType Type, typename ValueType> |
|||
storm::dd::Bdd<Type> const& SymbolicParetoCurveCheckResult<Type, ValueType>::getState() const { |
|||
return state; |
|||
} |
|||
|
|||
template class SymbolicParetoCurveCheckResult<storm::dd::DdType::CUDD, double>; |
|||
template class SymbolicParetoCurveCheckResult<storm::dd::DdType::Sylvan, double>; |
|||
} |
|||
} |
@ -0,0 +1,41 @@ |
|||
#ifndef STORM_MODELCHECKER_SYMBOLICPARETOCURVECHECKRESULT_H_ |
|||
#define STORM_MODELCHECKER_SYMBOLICPARETOCURVECHECKRESULT_H_ |
|||
|
|||
#include <vector> |
|||
|
|||
#include "storm/modelchecker/results/ParetoCurveCheckResult.h" |
|||
#include "storm/storage/dd/DdType.h" |
|||
#include "storm/storage/dd/Bdd.h" |
|||
|
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
template<storm::dd::DdType Type, typename ValueType = double> |
|||
class SymbolicParetoCurveCheckResult : public ParetoCurveCheckResult<ValueType> { |
|||
public: |
|||
|
|||
SymbolicParetoCurveCheckResult(); |
|||
SymbolicParetoCurveCheckResult(storm::dd::Bdd<Type> const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type> const& points, typename ParetoCurveCheckResult<ValueType>::polytope_type const& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type const& overApproximation); |
|||
SymbolicParetoCurveCheckResult(storm::dd::Bdd<Type> const& state, std::vector<typename ParetoCurveCheckResult<ValueType>::point_type>&& points, typename ParetoCurveCheckResult<ValueType>::polytope_type&& underApproximation, typename ParetoCurveCheckResult<ValueType>::polytope_type&& overApproximation); |
|||
|
|||
SymbolicParetoCurveCheckResult(SymbolicParetoCurveCheckResult const& other) = default; |
|||
SymbolicParetoCurveCheckResult& operator=(SymbolicParetoCurveCheckResult const& other) = default; |
|||
SymbolicParetoCurveCheckResult(SymbolicParetoCurveCheckResult&& other) = default; |
|||
SymbolicParetoCurveCheckResult& operator=(SymbolicParetoCurveCheckResult&& other) = default; |
|||
virtual ~SymbolicParetoCurveCheckResult() = default; |
|||
|
|||
virtual bool isSymbolicParetoCurveCheckResult() const override; |
|||
virtual bool isSymbolic() const override; |
|||
|
|||
virtual void filter(QualitativeCheckResult const& filter) override; |
|||
|
|||
storm::dd::Bdd<Type> const& getState() const; |
|||
|
|||
private: |
|||
// The state of the checked model to which the result applies |
|||
storm::dd::Bdd<Type> state; |
|||
}; |
|||
} |
|||
} |
|||
|
|||
#endif /* STORM_MODELCHECKER_SYMBOLICPARETOCURVECHECKRESULT_H_ */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue