Browse Source

implemented the extended filter functions of JANI for the symbolic/hybrid check results

Former-commit-id: 236ae3ea7f [formerly c2418a22c7]
Former-commit-id: 1a6a075921
tempestpy_adaptions
dehnert 8 years ago
parent
commit
0796eea632
  1. 10
      src/modelchecker/results/HybridQuantitativeCheckResult.cpp
  2. 1
      src/modelchecker/results/HybridQuantitativeCheckResult.h
  3. 13
      src/modelchecker/results/SymbolicQualitativeCheckResult.cpp
  4. 3
      src/modelchecker/results/SymbolicQualitativeCheckResult.h
  5. 4
      src/modelchecker/results/SymbolicQuantitativeCheckResult.cpp
  6. 1
      src/storage/expressions/ExpressionVisitor.h

10
src/modelchecker/results/HybridQuantitativeCheckResult.cpp

@ -57,7 +57,7 @@ namespace storm {
template<storm::dd::DdType Type, typename ValueType>
bool HybridQuantitativeCheckResult<Type, ValueType>::isResultForAllStates() const {
return true;
return (symbolicStates || explicitStates) == reachableStates;
}
template<storm::dd::DdType Type, typename ValueType>
@ -169,12 +169,16 @@ namespace storm {
template<storm::dd::DdType Type, typename ValueType>
ValueType HybridQuantitativeCheckResult<Type, ValueType>::sum() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Sum not implemented for hybrid results");
ValueType sum = symbolicValues.sumAbstract(symbolicValues.getContainedMetaVariables()).getValue();
for (auto const& value : explicitValues) {
sum += value;
}
return sum;
}
template<storm::dd::DdType Type, typename ValueType>
ValueType HybridQuantitativeCheckResult<Type, ValueType>::average() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Average not implemented for hybrid results");
return this->sum() / (symbolicStates || explicitStates).getNonZeroCount();
}
template<storm::dd::DdType Type, typename ValueType>

1
src/modelchecker/results/HybridQuantitativeCheckResult.h

@ -54,7 +54,6 @@ namespace storm {
virtual ValueType average() const override;
virtual void oneMinus() override;
private:

13
src/modelchecker/results/SymbolicQualitativeCheckResult.cpp

@ -8,7 +8,7 @@
namespace storm {
namespace modelchecker {
template <storm::dd::DdType Type>
SymbolicQualitativeCheckResult<Type>::SymbolicQualitativeCheckResult(storm::dd::Bdd<Type> const& reachableStates, storm::dd::Bdd<Type> const& truthValues) : reachableStates(reachableStates), truthValues(truthValues) {
SymbolicQualitativeCheckResult<Type>::SymbolicQualitativeCheckResult(storm::dd::Bdd<Type> const& reachableStates, storm::dd::Bdd<Type> const& truthValues) : reachableStates(reachableStates), states(reachableStates), truthValues(truthValues) {
// Intentionally left empty.
}
@ -19,7 +19,7 @@ namespace storm {
template <storm::dd::DdType Type>
bool SymbolicQualitativeCheckResult<Type>::isResultForAllStates() const {
return true;
return reachableStates == states;
}
template <storm::dd::DdType Type>
@ -48,22 +48,22 @@ namespace storm {
template <storm::dd::DdType Type>
storm::dd::Bdd<Type> const& SymbolicQualitativeCheckResult<Type>::getTruthValuesVector() const {
return truthValues;
return this->truthValues;
}
template <storm::dd::DdType Type>
bool SymbolicQualitativeCheckResult<Type>::existsTrue() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Exists not implemented for symbolic results");
return !this->truthValues.isZero();
}
template <storm::dd::DdType Type>
bool SymbolicQualitativeCheckResult<Type>::forallTrue() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Forall not implemented for symbolic results");
return this->truthValues == this->states;
}
template <storm::dd::DdType Type>
uint64_t SymbolicQualitativeCheckResult<Type>::count() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Count not implemented for symbolic results");
return this->truthValues.getNonZeroCount();
}
template <storm::dd::DdType Type>
@ -80,6 +80,7 @@ namespace storm {
void SymbolicQualitativeCheckResult<Type>::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<Type>().getTruthValuesVector();
this->states &= filter.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
}
template class SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>;

3
src/modelchecker/results/SymbolicQualitativeCheckResult.h

@ -46,6 +46,9 @@ namespace storm {
// The set of all reachable states.
storm::dd::Bdd<Type> reachableStates;
// The set of states for which this check result contains values.
storm::dd::Bdd<Type> states;
// The values of the qualitative check result.
storm::dd::Bdd<Type> truthValues;
};

4
src/modelchecker/results/SymbolicQuantitativeCheckResult.cpp

@ -93,12 +93,12 @@ namespace storm {
template<storm::dd::DdType Type, typename ValueType>
ValueType SymbolicQuantitativeCheckResult<Type, ValueType>::average() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Average not implemented for symbolic results");
return this->sum() / this->states.getNonZeroCount();
}
template<storm::dd::DdType Type, typename ValueType>
ValueType SymbolicQuantitativeCheckResult<Type, ValueType>::sum() const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Sum not implemented for symbolic results");
return this->values.sumAbstract(this->values.getContainedMetaVariables()).getValue();
}
template<storm::dd::DdType Type, typename ValueType>

1
src/storage/expressions/ExpressionVisitor.h

@ -2,6 +2,7 @@
#define STORM_STORAGE_EXPRESSIONS_EXPRESSIONVISITOR_H_
#include <boost/any.hpp>
#include <boost/none.hpp>
namespace storm {
namespace expressions {

Loading…
Cancel
Save