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.

32 lines
1.3 KiB

  1. import stormpy
  2. import stormpy.logic
  3. from helpers.helper import get_example_path
  4. class TestParse:
  5. def test_parse_prism_program(self):
  6. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  7. assert program.nr_modules == 1
  8. assert program.model_type == stormpy.PrismModelType.DTMC
  9. assert not program.has_undefined_constants
  10. def test_parse_formula(self):
  11. prop = "P=? [F \"one\"]"
  12. formulas = stormpy.parse_formulas(prop)
  13. assert len(formulas) == 1
  14. assert str(formulas[0]) == prop
  15. def test_parse_explicit_dtmc(self):
  16. model = stormpy.parse_explicit_model(get_example_path("dtmc", "die.tra"), get_example_path("dtmc", "die.lab"))
  17. assert model.nr_states == 13
  18. assert model.nr_transitions == 20
  19. assert model.model_type == stormpy.ModelType.DTMC
  20. assert not model.supports_parameters
  21. assert type(model) is stormpy.SparseDtmc
  22. def test_parse_explicit_mdp(self):
  23. model = stormpy.parse_explicit_model(get_example_path("mdp", "two_dice.tra"), get_example_path("mdp", "two_dice.lab"))
  24. assert model.nr_states == 169
  25. assert model.nr_transitions == 436
  26. assert model.model_type == stormpy.ModelType.MDP
  27. assert not model.supports_parameters
  28. assert type(model) is stormpy.SparseMdp