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.

29 lines
1.2 KiB

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