1#include "storm-config.h"
19class GmmxxDoubleGmresEnvironment {
22 static const bool isExact =
false;
33class EigenDoubleDGmresEnvironment {
36 static const bool isExact =
false;
48class EigenRationalLUEnvironment {
51 static const bool isExact =
true;
60class NativeSorEnvironment {
63 static const bool isExact =
false;
74class NativePowerEnvironment {
77 static const bool isExact =
false;
87class NativeWalkerChaeEnvironment {
90 static const bool isExact =
false;
101template<
typename TestType>
102class ConditionalDtmcPrctlModelCheckerTest :
public ::testing::Test {
104 typedef typename TestType::ValueType
ValueType;
105 ConditionalDtmcPrctlModelCheckerTest() : _environment(TestType::createEnvironment()) {}
107 void SetUp()
override {
109 GTEST_SKIP() <<
"Z3 not available.";
117 return storm::utility::convertNumber<ValueType>(input);
127typedef ::testing::Types<
129 GmmxxDoubleGmresEnvironment, EigenDoubleDGmresEnvironment,
131 EigenRationalLUEnvironment, NativeSorEnvironment, NativePowerEnvironment, NativeWalkerChaeEnvironment>
136TYPED_TEST(ConditionalDtmcPrctlModelCheckerTest, Conditional) {
137 typedef typename TestFixture::ValueType
ValueType;
145 ASSERT_EQ(4ul, model->getNumberOfStates());
146 ASSERT_EQ(5ul, model->getNumberOfTransitions());
148 std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc = model->template as<storm::models::sparse::Dtmc<ValueType>>();
154 auto expManager = std::make_shared<storm::expressions::ExpressionManager>();
156 std::shared_ptr<storm::logic::Formula const> formula = formulaParser.parseSingleFormulaFromString(
"P=? [F \"target\"]");
158 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
160 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[0], this->precision());
162 formula = formulaParser.parseSingleFormulaFromString(
"P=? [F \"target\" || F \"condition\"]");
164 result = checker.check(this->env(), *formula);
166 EXPECT_NEAR(storm::utility::one<ValueType>(), quantitativeResult2[0], this->precision());
168 formula = formulaParser.parseSingleFormulaFromString(
"R=? [F \"target\"]");
170 result = checker.check(this->env(), *formula);
172 EXPECT_EQ(storm::utility::infinity<ValueType>(), quantitativeResult3[0]);
174 formula = formulaParser.parseSingleFormulaFromString(
"R=? [F \"target\" || F \"condition\"]");
176 result = checker.check(this->env(), *formula);
178 EXPECT_NEAR(storm::utility::one<ValueType>(), quantitativeResult4[0], this->precision());
void setPrecision(storm::RationalNumber value)
void setPreconditioner(storm::solver::EigenLinearEquationSolverPreconditioner value)
void setMethod(storm::solver::EigenLinearEquationSolverMethod value)
SolverEnvironment & solver()
void setMethod(storm::solver::GmmxxLinearEquationSolverMethod value)
void setPrecision(storm::RationalNumber value)
void setPreconditioner(storm::solver::GmmxxLinearEquationSolverPreconditioner value)
void setSorOmega(storm::RationalNumber const &value)
void setMaximalNumberOfIterations(uint64_t value)
void setMethod(storm::solver::NativeLinearEquationSolverMethod value)
void setPrecision(storm::RationalNumber value)
void setLinearEquationSolverType(storm::solver::EquationSolverType const &value, bool isSetFromDefault=false)
EigenSolverEnvironment & eigen()
NativeSolverEnvironment & native()
GmmxxSolverEnvironment & gmmxx()
BuilderOptions & setBuildAllLabels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
BuilderOptions & setBuildAllRewardModels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > build()
Convert the program given at construction time to an abstract model.
ExplicitQuantitativeCheckResult< ValueType > & asExplicitQuantitativeCheckResult()
static storm::prism::Program parse(std::string const &filename, bool prismCompatability=false)
Parses the given file into the PRISM storage classes assuming it complies with the PRISM syntax.
SFTBDDChecker::ValueType ValueType
NumberType parseNumber(std::string const &value)
Parse number from string.
TYPED_TEST(GraphTestAR, SymbolicProb01StochasticGameDieSmall)
TYPED_TEST_SUITE(GraphTestAR, TestingTypes,)
::testing::Types< Cudd, Sylvan > TestingTypes