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.

27 lines
811 B

  1. import stormpy
  2. import stormpy.logic
  3. from helpers.helper import get_example_path
  4. import math
  5. class TestBuild:
  6. def test_import(self):
  7. import stormpy.dft
  8. def test_build_dft(self):
  9. try:
  10. import stormpy.dft
  11. except ImportError:
  12. # No support for DFTs
  13. return
  14. model = stormpy.dft.build_sparse_model_from_json_dft(get_example_path("dft", "and.json"))
  15. formulas = stormpy.parse_properties("T=? [ F \"failed\" ]")
  16. assert model.nr_states == 4
  17. assert model.nr_transitions == 5
  18. assert len(model.initial_states) == 1
  19. initial_state = model.initial_states[0]
  20. assert initial_state == 1
  21. result = stormpy.model_checking(model, formulas[0])
  22. assert math.isclose(result.at(initial_state), 3)