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.

35 lines
1.7 KiB

  1. import stormpy
  2. import stormpy.logic
  3. from helpers.helper import get_example_path
  4. class TestTransformation:
  5. def test_transform_symbolic_dtmc_to_sparse(self):
  6. program = stormpy.parse_prism_program(get_example_path("dtmc", "crowds5_5.pm"))
  7. symbolic_model = stormpy.build_symbolic_model(program)
  8. assert symbolic_model.nr_states == 8607
  9. assert symbolic_model.nr_transitions == 15113
  10. assert symbolic_model.model_type == stormpy.ModelType.DTMC
  11. assert not symbolic_model.supports_parameters
  12. assert type(symbolic_model) is stormpy.SymbolicSylvanDtmc
  13. sparse_model = stormpy.transform_to_sparse_model(symbolic_model)
  14. assert sparse_model.nr_states == 8607
  15. assert sparse_model.nr_transitions == 15113
  16. assert sparse_model.model_type == stormpy.ModelType.DTMC
  17. assert not sparse_model.supports_parameters
  18. assert type(sparse_model) is stormpy.SparseDtmc
  19. def test_transform_symbolic_parametric_dtmc_to_sparse(self):
  20. program = stormpy.parse_prism_program(get_example_path("pdtmc", "parametric_die.pm"))
  21. model = stormpy.build_symbolic_parametric_model(program)
  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 type(model) is stormpy.SymbolicSylvanParametricDtmc
  27. symbolic_model = stormpy.transform_to_sparse_model(model)
  28. assert symbolic_model.nr_states == 13
  29. assert symbolic_model.nr_transitions == 20
  30. assert symbolic_model.model_type == stormpy.ModelType.DTMC
  31. assert symbolic_model.supports_parameters
  32. assert type(symbolic_model) is stormpy.SparseParametricDtmc