1#include "storm-config.h"
10TEST(PrismProgramTest, FlattenModules) {
14 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
21TEST(PrismProgramTest, FlattenModules_Wlan_Mathsat) {
25 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
32TEST(PrismProgramTest, FlattenModules_Csma_Mathsat) {
36 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
43TEST(PrismProgramTest, FlattenModules_Firewire_Mathsat) {
47 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
54TEST(PrismProgramTest, FlattenModules_Coin_Mathsat) {
58 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
65TEST(PrismProgramTest, FlattenModules_Dice_Mathsat) {
69 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
78TEST(PrismProgramTest, FlattenModules_Leader_Z3) {
82 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
89TEST(PrismProgramTest, FlattenModules_Wlan_Z3) {
93 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
100TEST(PrismProgramTest, FlattenModules_Csma_Z3) {
104 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
111TEST(PrismProgramTest, FlattenModules_Firewire_Z3) {
115 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
122TEST(PrismProgramTest, FlattenModules_Coin_Z3) {
126 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
133TEST(PrismProgramTest, FlattenModules_Dice_Z3) {
137 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
145TEST(PrismProgramTest, ConvertToJani) {
150 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
153 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
156 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
159 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
162 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
165 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
168 ASSERT_NO_THROW(janiModel = prismProgram.
toJani());
171TEST(PrismProgramTest, ReplaceInitialStates) {
180TEST(PrismProgramTest, ReplaceConstantByVariable) {
187 EXPECT_FALSE(transformedPrismProgram.
hasConstant(
"CrowdSize"));
TEST(PrismProgramTest, ConvertToJani)
bool isSyntacticallyEqual(storm::expressions::Expression const &other) const
Checks whether the two expressions are syntatically the same.
Expression integer(int_fast64_t value) const
Creates an expression that characterizes the given integer literal.
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.
std::size_t getNumberOfCommands() const
Retrieves the number of commands of this module.
Program replaceConstantByVariable(Constant const &c, expressions::Expression const &lowerBound, expressions::Expression const &upperBound, bool observable=true) const
Substitutes the given constant by a fresh global variable that is bound between lowerBound and upperB...
Module const & getModule(uint_fast64_t index) const
Retrieves the module with the given index.
IntegerVariable const & getGlobalIntegerVariable(std::string const &variableName) const
Retrieves a the global integer variable with the given name.
Constant const & getConstant(std::string const &constantName) const
Retrieves the constant with the given name if it exists.
Program substituteFormulas() const
Substitutes all formulas appearing in the expressions of the program by their defining expressions.
storm::expressions::ExpressionManager & getManager() const
Retrieves the manager responsible for the expressions of this program.
Program replaceVariableInitializationByInitExpression() const
Replace the initialization in variables by an init-expression.
bool hasConstant(std::string const &constantName) const
Retrieves whether the given constant exists in the program.
storm::expressions::Expression getInitialStatesExpression() const
Retrieves an expression characterizing the initial states.
std::size_t getNumberOfModules() const
Retrieves the number of modules in the program.
bool hasInitialConstruct() const
Retrieves whether the program specifies an initial construct.
Program flattenModules(std::shared_ptr< storm::utility::solver::SmtSolverFactory > const &smtSolverFactory=std::shared_ptr< storm::utility::solver::SmtSolverFactory >(new storm::utility::solver::SmtSolverFactory())) const
Creates an equivalent program that contains exactly one module.
storm::jani::Model toJani(bool allVariablesGlobal=true, std::string suffix="") const
Converts the PRISM model into an equivalent JANI model.