The source code and dockerfile for the GSW2024 AI Lab.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

37 lines
1.7 KiB

4 weeks ago
  1. import stormpy
  2. import stormpy.logic
  3. from helpers.helper import get_example_path
  4. import pytest
  5. class TestPrism:
  6. def test_prism_to_jani_states(self):
  7. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  8. orig_properties = stormpy.parse_properties_for_prism_program("P=? [F s=7]", program)
  9. assert len(orig_properties) == 1
  10. jani_model, new_properties = program.to_jani(orig_properties)
  11. assert len(new_properties) == len(orig_properties)
  12. def test_prism_to_jani_labels(self):
  13. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  14. orig_properties = stormpy.parse_properties_for_prism_program("P=? [F \"two\"]", program)
  15. assert len(orig_properties) == 1
  16. jani_model, new_properties = program.to_jani(orig_properties)
  17. assert len(new_properties) == len(orig_properties)
  18. def test_prism_to_jani_repetitive(self):
  19. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  20. orig_properties = stormpy.parse_properties_for_prism_program("P=? [F \"two\"]", program)
  21. jani_model, new_properties = program.to_jani(orig_properties)
  22. assert len(new_properties) == len(orig_properties)
  23. orig_properties = stormpy.parse_properties_for_prism_program("P=? [F s=7]", program)
  24. jani_model, new_properties = program.to_jani(orig_properties, suffix = "2")
  25. assert len(new_properties) == len(orig_properties)
  26. def test_prism_variables(selfs):
  27. program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
  28. module = program.modules[0]
  29. assert len(module.integer_variables) == 2
  30. assert len(module.boolean_variables) == 0