1#include "storm-config.h"
27template<
typename ValueType>
34 return result->template asExplicitQuantitativeCheckResult<ValueType>()[*model->getInitialStates().begin()];
42#ifndef STORM_HAVE_SMT_SOLVER
43 GTEST_SKIP() <<
"No SMT solver available.";
48TEST(EnvironmentFactoryTest, DefaultEnvironmentIsNotSound) {
53TEST(EnvironmentFactoryTest, SoundEnvironmentSelectsSoundMethods) {
62 EXPECT_EQ(storm::solver::MinMaxMethod::Topological, solver.
minMax().
getMethod());
66 EXPECT_EQ(storm::solver::NativeLinearEquationSolverMethod::OptimisticValueIteration, solver.
native().
getMethod());
67 EXPECT_EQ(storm::solver::EigenLinearEquationSolverMethod::SparseLU, solver.
eigen().
getMethod());
68 EXPECT_EQ(storm::solver::GameMethod::PolicyIteration, solver.
game().
getMethod());
85TEST(EnvironmentFactoryTest, ClonedFactoryCreatesSoundEnvironment) {
87 EXPECT_TRUE(factory->create().solver().isForceSoundness());
98 double const precision = 1e-6;
99 std::string
const dtmcFile = STORM_TEST_RESOURCES_DIR
"/dtmc/die.pm";
100 std::string
const dtmcFormula =
"P=? [F \"one\"]";
101 EXPECT_NEAR(1.0 / 6.0, checkInitialState<double>(env, dtmcFile, dtmcFormula), precision);
102 EXPECT_NEAR(checkInitialState<double>(cliEnv, dtmcFile, dtmcFormula), checkInitialState<double>(env, dtmcFile, dtmcFormula), precision);
104 std::string
const mdpFile = STORM_TEST_RESOURCES_DIR
"/mdp/two_dice.nm";
105 std::string
const mdpFormula =
"Pmin=? [F \"two\"]";
106 EXPECT_NEAR(1.0 / 36.0, checkInitialState<double>(env, mdpFile, mdpFormula), precision);
107 EXPECT_NEAR(checkInitialState<double>(cliEnv, mdpFile, mdpFormula), checkInitialState<double>(env, mdpFile, mdpFormula), precision);
110TEST(EnvironmentFactoryTest, DefaultEnvironmentIsNotExact) {
115TEST(EnvironmentFactoryTest, ExactEnvironmentSelectsExactMethods) {
124 EXPECT_EQ(storm::solver::MinMaxMethod::Topological, solver.
minMax().
getMethod());
128 EXPECT_EQ(storm::solver::NativeLinearEquationSolverMethod::RationalSearch, solver.
native().
getMethod());
129 EXPECT_EQ(storm::solver::EigenLinearEquationSolverMethod::SparseLU, solver.
eigen().
getMethod());
130 EXPECT_EQ(storm::solver::GameMethod::PolicyIteration, solver.
game().
getMethod());
131 EXPECT_EQ(storm::solver::LraMethod::GainBiasEquations, solver.
lra().
getDetLraMethod());
147TEST(EnvironmentFactoryTest, ClonedFactoryCreatesExactEnvironment) {
149 EXPECT_TRUE(factory->create().solver().isForceExact());
160 std::string
const dtmcFile = STORM_TEST_RESOURCES_DIR
"/dtmc/die.pm";
161 std::string
const dtmcFormula =
"P=? [F \"one\"]";
163 EXPECT_EQ(checkInitialState<storm::RationalNumber>(cliEnv, dtmcFile, dtmcFormula), checkInitialState<storm::RationalNumber>(env, dtmcFile, dtmcFormula));
165 std::string
const mdpFile = STORM_TEST_RESOURCES_DIR
"/mdp/two_dice.nm";
166 std::string
const mdpFormula =
"Pmin=? [F \"two\"]";
168 EXPECT_EQ(checkInitialState<storm::RationalNumber>(cliEnv, mdpFile, mdpFormula), checkInitialState<storm::RationalNumber>(env, mdpFile, mdpFormula));
TEST(EnvironmentFactoryTest, DefaultEnvironmentIsNotSound)
TEST_F(EnvironmentFactoryModelCheckingTest, MatchesSoundCommandLineOption)
storm::solver::EigenLinearEquationSolverMethod const & getMethod() const
bool isMethodSetFromDefault() const
SolverEnvironment & solver()
ModelCheckerEnvironment & modelchecker()
bool const & isMethodSetFromDefault() const
storm::solver::GameMethod const & getMethod() const
storm::solver::LraMethod const & getNondetLraMethod() const
bool const & isDetLraMethodSetFromDefault() const
bool const & isNondetLraMethodSetFromDefault() const
storm::solver::LraMethod const & getDetLraMethod() const
bool const & isMethodSetFromDefault() const
storm::solver::MinMaxMethod const & getMethod() const
SteadyStateDistributionAlgorithm getSteadyStateDistributionAlgorithm() const
bool const & isMethodSetFromDefault() const
storm::solver::NativeLinearEquationSolverMethod const & getMethod() const
TopologicalSolverEnvironment & topological()
EigenSolverEnvironment & eigen()
MinMaxSolverEnvironment & minMax()
storm::solver::EquationSolverType const & getLinearEquationSolverType() const
bool isLinearEquationSolverTypeSetFromDefaultValue() const
bool isLpSolverTypeSetFromDefaultValue() const
GameSolverEnvironment & game()
bool isForceExact() const
storm::solver::LpSolverType const & getLpSolverType() const
NativeSolverEnvironment & native()
LongRunAverageSolverEnvironment & lra()
bool isForceSoundness() const
storm::solver::MinMaxMethod const & getUnderlyingMinMaxMethod() const
storm::solver::EquationSolverType const & getUnderlyingEquationSolverType() const
bool const & isUnderlyingMinMaxMethodSetFromDefault() const
bool const & isUnderlyingEquationSolverTypeSetFromDefault() const
static storm::Environment buildEnvironment()
void setFromExplodedString(std::vector< std::string > const &commandLineArguments)
This function parses the given command line arguments (represented by several strings) and sets all r...
modules::ModuleSettings const & getModule(std::string const &moduleName) const
Retrieves the settings of the module with the given name.
static const std::string moduleName
void restoreDefaults()
Restores the default values for all arguments of all options and marks all options as not set.
virtual storm::Environment create() const
Creates a new environment with default values.
virtual std::unique_ptr< EnvironmentFactory > clone() const override
virtual std::unique_ptr< EnvironmentFactory > clone() const override
storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > createTask(std::shared_ptr< const storm::logic::Formula > const &formula, bool onlyInitialStatesRelevant=false)
std::vector< storm::jani::Property > parsePropertiesForPrismProgram(std::string const &inputString, storm::prism::Program const &program, boost::optional< std::set< std::string > > const &propertyFilter)
storm::prism::Program parseProgram(std::string const &filename, bool prismCompatibility, bool simplify)
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
std::unique_ptr< storm::modelchecker::CheckResult > verifyWithSparseEngine(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Dtmc< ValueType > > const &dtmc, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, bool preferEliminationChecker=false)
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildSparseModel(storm::languages::SymbolicModelDescription const &model, storm::builder::BuilderOptions const &options, typename storm::builder::ExplicitModelBuilder< ValueType >::Options const &explorationOptions=typename storm::builder::ExplicitModelBuilder< ValueType >::Options())
SettingsManager & mutableManager()
Retrieves the settings manager.
storm::Environment getExactEnvironment()
Creates a new environment which enforces exact computations (via ExactEnvironmentFactory).
storm::Environment getSoundEnvironment()
Creates a new environment which enforces sound computations (via SoundEnvironmentFactory).
std::conditional_t< storm::NumberTraits< ValueType >::HasInfinity, ValueType, ExtendedNumber< ValueType > > ExtendedValueType
The type to use for values that may be infinite.
TargetType convertNumber(SourceType const &number)