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.

29 lines
816 B

4 weeks ago
  1. import stormpy
  2. import stormpy.dft
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_dfts_01():
  6. # Load from JSON
  7. path_json = stormpy.examples.files.dft_json_and
  8. dft_small = stormpy.dft.load_dft_json_file(path_json)
  9. print(dft_small)
  10. # Load from Galileo
  11. path = stormpy.examples.files.dft_galileo_hecs
  12. dft = stormpy.dft.load_dft_galileo_file(path)
  13. print("DFT with {} elements.".format(dft.nr_elements()))
  14. print("DFT has {} BEs and {} dynamic elements.".format(dft.nr_be(), dft.nr_dynamic()))
  15. # Analyze
  16. formula_str = "T=? [ F \"failed\" ]"
  17. formulas = stormpy.parse_properties(formula_str)
  18. results = stormpy.dft.analyze_dft(dft, [formulas[0].raw_formula])
  19. result = results[0]
  20. print(result)
  21. if __name__ == '__main__':
  22. example_dfts_01()