|
|
@ -5,7 +5,7 @@ from helpers.helper import get_example_path |
|
|
|
class TestModel: |
|
|
|
def test_build_dtmc_from_prism_program(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
model = stormpy.build_model_from_prism_program(program) |
|
|
|
model = stormpy.build_model(program) |
|
|
|
assert model.nr_states == 13 |
|
|
|
assert model.nr_transitions == 20 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -15,8 +15,8 @@ class TestModel: |
|
|
|
def test_build_dtmc_from_prism_program_formulas(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
prop = "P=? [F \"one\"]" |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program(prop, program) |
|
|
|
model = stormpy.build_model_from_prism_program(program, formulas) |
|
|
|
properties = stormpy.parse_properties_for_prism_program(prop, program, None) |
|
|
|
model = stormpy.build_model(program, properties) |
|
|
|
assert model.nr_states == 13 |
|
|
|
assert model.nr_transitions == 20 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -29,8 +29,8 @@ class TestModel: |
|
|
|
assert program.model_type == stormpy.PrismModelType.DTMC |
|
|
|
assert program.has_undefined_constants |
|
|
|
prop = "P=? [F s=5]" |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program(prop, program) |
|
|
|
model = stormpy.build_parametric_model_from_prism_program(program, formulas) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program(prop, program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas) |
|
|
|
assert model.nr_states == 613 |
|
|
|
assert model.nr_transitions == 803 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -40,8 +40,8 @@ class TestModel: |
|
|
|
|
|
|
|
def test_build_dtmc(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas) |
|
|
|
assert model.nr_states == 13 |
|
|
|
assert model.nr_transitions == 20 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -50,8 +50,8 @@ class TestModel: |
|
|
|
|
|
|
|
def test_build_parametric_dtmc(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F s=5 ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F s=5 ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas) |
|
|
|
assert model.nr_states == 613 |
|
|
|
assert model.nr_transitions == 803 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -61,8 +61,8 @@ class TestModel: |
|
|
|
|
|
|
|
def test_build_dtmc_supporting_parameters(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas) |
|
|
|
assert model.nr_states == 13 |
|
|
|
assert model.nr_transitions == 20 |
|
|
|
assert model.model_type == stormpy.ModelType.DTMC |
|
|
@ -72,8 +72,8 @@ class TestModel: |
|
|
|
|
|
|
|
def test_label(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas) |
|
|
|
labels = model.labels |
|
|
|
assert len(labels) == 3 |
|
|
|
assert "init" in labels |
|
|
@ -83,16 +83,16 @@ class TestModel: |
|
|
|
|
|
|
|
def test_initial_states(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program) |
|
|
|
model = stormpy.build_model(program, formulas) |
|
|
|
initial_states = model.initial_states |
|
|
|
assert len(initial_states) == 1 |
|
|
|
assert 0 in initial_states |
|
|
|
|
|
|
|
def test_label_parametric(self): |
|
|
|
program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm")) |
|
|
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F s=5 ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas[0]) |
|
|
|
formulas = stormpy.parse_properties_for_prism_program("P=? [ F s=5 ]", program) |
|
|
|
model = stormpy.build_parametric_model(program, formulas) |
|
|
|
labels = model.labels |
|
|
|
assert len(labels) == 3 |
|
|
|
assert "init" in labels |
|
|
|