You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.8 KiB

  1. import stormpy
  2. import stormpy.info
  3. import stormpy.logic
  4. from helpers.helper import get_example_path
  5. from configurations import pars
  6. @pars
  7. class TestParametricModel:
  8. def test_build_parametric_dtmc(self):
  9. program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm"))
  10. formulas = stormpy.parse_properties_for_prism_program("P=? [ F s=5 ]", program)
  11. model = stormpy.build_parametric_model(program, formulas)
  12. assert model.nr_states == 613
  13. assert model.nr_transitions == 803
  14. assert model.model_type == stormpy.ModelType.DTMC
  15. assert model.supports_parameters
  16. assert model.has_parameters
  17. assert type(model) is stormpy.SparseParametricDtmc
  18. def test_build_dtmc_supporting_parameters(self):
  19. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  20. formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program)
  21. model = stormpy.build_parametric_model(program, formulas)
  22. assert model.nr_states == 13
  23. assert model.nr_transitions == 20
  24. assert model.model_type == stormpy.ModelType.DTMC
  25. assert model.supports_parameters
  26. assert not model.has_parameters
  27. assert type(model) is stormpy.SparseParametricDtmc
  28. def test_build_parametric_mdp(self):
  29. program = stormpy.parse_prism_program(get_example_path("pmdp", "two_dice.nm"))
  30. formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"two\" ]", program)
  31. model = stormpy.build_parametric_model(program, formulas)
  32. assert model.nr_states == 169
  33. assert model.nr_transitions == 435
  34. assert model.model_type == stormpy.ModelType.MDP
  35. assert model.supports_parameters
  36. assert type(model) is stormpy.SparseParametricMdp