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
877 B

  1. import stormpy
  2. import stormpy.core
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_analysis_04():
  6. path = stormpy.examples.files.prism_dtmc_die
  7. prism_program = stormpy.parse_prism_program(path)
  8. formula_str = "P=? [F s=7 & d=2]"
  9. properties = stormpy.parse_properties(formula_str, prism_program)
  10. options = stormpy.BuilderOptions([p.raw_formula for p in properties])
  11. options.set_build_state_valuations()
  12. model = stormpy.build_sparse_model_with_options(prism_program, options)
  13. result = stormpy.model_checking(model, properties[0])
  14. # Print the model checking result for all states
  15. print("Model checking results:")
  16. for i in range(len(model.states)):
  17. print("\tstate #{}\t {}:\t {}".format(i,model.state_valuations.get_state(i),result.at(i)))
  18. if __name__ == '__main__':
  19. example_analysis_04()