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.

32 lines
1.3 KiB

2 months ago
  1. import stormpy
  2. import stormpy.core
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_analysis_03():
  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. model = stormpy.build_model(prism_program, properties)
  11. env = stormpy.Environment()
  12. env.solver_environment.set_linear_equation_solver_type(stormpy.EquationSolverType.native)
  13. env.solver_environment.native_solver_environment.method = stormpy.NativeLinearEquationSolverMethod.optimistic_value_iteration
  14. env.solver_environment.native_solver_environment.precision = stormpy.Rational("0.9")
  15. #env.solver_environment.native_solver_environment.maximum_iterations = 2
  16. result = stormpy.model_checking(model, properties[0], environment=env)
  17. print(result.at(model.initial_states[0]))
  18. dd_model = stormpy.build_symbolic_model(prism_program, properties)
  19. result = stormpy.model_checking(dd_model, properties[0], environment=env)
  20. filter = stormpy.create_filter_initial_states_symbolic(dd_model)
  21. result.filter(filter)
  22. assert result.min == result.max
  23. print(result.min)
  24. if __name__ == '__main__':
  25. example_analysis_03()