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.

26 lines
660 B

4 weeks ago
  1. import stormpy
  2. import stormpy.core
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_exploration_03():
  6. """
  7. Topological sort
  8. :return:
  9. """
  10. path = stormpy.examples.files.prism_dtmc_die
  11. prism_program = stormpy.parse_prism_program(path)
  12. formula_str = "P=? [F s=7 & d=2]"
  13. properties = stormpy.parse_properties_for_prism_program(formula_str, prism_program)
  14. model = stormpy.build_model(prism_program, properties)
  15. sorted = stormpy.topological_sort(model)
  16. print(sorted)
  17. sorted = stormpy.topological_sort(model, forward=False)
  18. print(sorted)
  19. if __name__ == '__main__':
  20. example_exploration_03()