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.

33 lines
1.3 KiB

4 weeks ago
  1. import stormpy
  2. import stormpy.core
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_getting_started_02():
  6. path = stormpy.examples.files.prism_dtmc_die
  7. prism_program = stormpy.parse_prism_program(path)
  8. model = stormpy.build_model(prism_program)
  9. print("Number of states: {}".format(model.nr_states))
  10. print("Number of transitions: {}".format(model.nr_transitions))
  11. print("Labels in the model: {}".format(model.labeling.get_labels()))
  12. formula_str = "P=? [F s=2]"
  13. properties = stormpy.parse_properties(formula_str, prism_program)
  14. model_for_formula = stormpy.build_model(prism_program, properties)
  15. print("Number of states: {}".format(model_for_formula.nr_states))
  16. print("Number of transitions: {}".format(model_for_formula.nr_transitions))
  17. print("Labels in the model: {}".format(model_for_formula.labeling.get_labels()))
  18. formula_str_2 = "P=? [F s=7 & d=2]"
  19. properties_2 = stormpy.parse_properties(formula_str_2, prism_program)
  20. model_for_formula_2 = stormpy.build_model(prism_program, properties_2)
  21. print("Number of states: {}".format(model_for_formula_2.nr_states))
  22. print("Number of transitions: {}".format(model_for_formula_2.nr_transitions))
  23. print("Labels in the model: {}".format(model_for_formula_2.labeling.get_labels()))
  24. if __name__ == '__main__':
  25. example_getting_started_02()