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

  1. import stormpy
  2. import stormpy.core
  3. import stormpy.pars
  4. import pycarl
  5. import pycarl.core
  6. import stormpy.examples
  7. import stormpy.examples.files
  8. def example_getting_started_04():
  9. path = stormpy.examples.files.prism_pdtmc_die
  10. prism_program = stormpy.parse_prism_program(path)
  11. formula_str = "P=? [F s=7 & d=2]"
  12. properties = stormpy.parse_properties_for_prism_program(formula_str, prism_program)
  13. model = stormpy.build_parametric_model(prism_program, properties)
  14. print("Model supports parameters: {}".format(model.supports_parameters))
  15. parameters = model.collect_probability_parameters()
  16. assert len(parameters) == 2
  17. instantiator = stormpy.pars.PDtmcInstantiator(model)
  18. point = dict()
  19. for x in parameters:
  20. print(x.name)
  21. point[x] = stormpy.RationalRF(0.4)
  22. instantiated_model = instantiator.instantiate(point)
  23. result = stormpy.model_checking(instantiated_model, properties[0])
  24. print(result)
  25. if __name__ == '__main__':
  26. example_getting_started_04()