From 03605b44c42eb9a90242acbb436377ac59f3d5c0 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 13 Jul 2020 22:28:21 +0200 Subject: [PATCH] Renamed preprocess_prism_program to preprocess_symbolic_input --- src/core/input.cpp | 4 ++-- tests/gspn/test_gspn_io.py | 10 ++++------ tests/pars/test_parametric_model.py | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/input.cpp b/src/core/input.cpp index 5b014c3..30e53e6 100644 --- a/src/core/input.cpp +++ b/src/core/input.cpp @@ -24,7 +24,7 @@ void define_input(py::module& m) { return storm::api::parseJaniModel(path); }, "Parse Jani model", py::arg("path")); - m.def("preprocess_prism_program", [](storm::storage::SymbolicModelDescription const& input, std::vector properties, std::string constantDefinitionString){ + m.def("preprocess_symbolic_input", [](storm::storage::SymbolicModelDescription const& input, std::vector properties, std::string constantDefinitionString){ // Substitute constant definitions in symbolic input. std::map constantDefinitions; storm::storage::SymbolicModelDescription output; @@ -36,7 +36,7 @@ void define_input(py::module& m) { } //ensureNoUndefinedPropertyConstants(outputProperties); return std::pair>(output, outputProperties); - }, "Preprocess Prism program", py::arg("prism_program"), py::arg("properties"), py::arg("constant_definition_string")); + }, "Preprocess symoblic input", py::arg("symbolic_model_description"), py::arg("properties"), py::arg("constant_definition_string")); // JaniType py::enum_(m, "JaniModelType", "Type of the Jani model") diff --git a/tests/gspn/test_gspn_io.py b/tests/gspn/test_gspn_io.py index ff37406..079a0be 100644 --- a/tests/gspn/test_gspn_io.py +++ b/tests/gspn/test_gspn_io.py @@ -50,9 +50,8 @@ class TestGSPNJani: properties = jani_builder.create_deadlock_properties(jani_program) # Instantiate constants - description = stormpy.SymbolicModelDescription(jani_program) - constant_definitions = description.parse_constant_definitions("TIME_BOUND=1") - jani_program = description.instantiate_constants(constant_definitions).as_jani_model() + jani_program, properties = stormpy.preprocess_symbolic_input(jani_program, properties, "TIME_BOUND=1") + jani_program = jani_program.as_jani_model() # Build model # Leads to incorrect result @@ -64,8 +63,7 @@ class TestGSPNJani: assert initial_state == 0 result = stormpy.model_checking(model, properties[0]) assert math.isclose(result.at(initial_state), 1.0) - # Not parsable - #result = stormpy.model_checking(model, properties[1]) - #assert math.isclose(result.at(initial_state), 0.09123940783) + result = stormpy.model_checking(model, properties[1]) + assert math.isclose(result.at(initial_state), 0.09123940783) result = stormpy.model_checking(model, properties[2]) assert math.isclose(result.at(initial_state), 5.445544554455446) diff --git a/tests/pars/test_parametric_model.py b/tests/pars/test_parametric_model.py index b0fc8da..87db6e5 100644 --- a/tests/pars/test_parametric_model.py +++ b/tests/pars/test_parametric_model.py @@ -22,7 +22,7 @@ class TestSparseParametricModel: def test_build_parametric_dtmc_preprocess(self): program = stormpy.parse_prism_program(get_example_path("pdtmc", "herman5.pm")) formulas = stormpy.parse_properties_for_prism_program("R=? [ F \"stable\" ]", program) - trans_program, trans_formulas = stormpy.preprocess_prism_program(program, formulas, "") + trans_program, trans_formulas = stormpy.preprocess_symbolic_input(program, formulas, "") trans_prism = trans_program.as_prism_program() model = stormpy.build_parametric_model(trans_prism, trans_formulas) assert model.nr_states == 33 @@ -70,7 +70,7 @@ class TestSymbolicParametricModel: def test_build_parametric_dtmc_preprocess(self): program = stormpy.parse_prism_program(get_example_path("pdtmc", "herman5.pm")) formulas = stormpy.parse_properties_for_prism_program("R=? [ F \"stable\" ]", program) - trans_program, trans_formulas = stormpy.preprocess_prism_program(program, formulas, "") + trans_program, trans_formulas = stormpy.preprocess_symbolic_input(program, formulas, "") trans_prism = trans_program.as_prism_program() model = stormpy.build_symbolic_parametric_model(trans_prism, trans_formulas) assert model.nr_states == 33