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.

47 lines
1.1 KiB

  1. ****************************
  2. Getting Started
  3. ****************************
  4. A Quick Tour through Stormpy
  5. ================================
  6. We start with a selection of high-level constructs in stormpy.
  7. In order to do this, we import stormpy::
  8. import stormpy
  9. import stormpy.core
  10. Building models
  11. -----------------------
  12. There are several ways to create a Markov chain.
  13. One of the easiest is to parse a description of such a Markov chain and to let storm build the chain.
  14. Here, we build a Markov chain from a prism program.
  15. Stormpy comes with a small set of examples, which we use here::
  16. import stormpy.examples
  17. import stormpy.examples.files
  18. With this, we can now import the path of our prism file::
  19. path = stormpy.examples.files.knuth_yao
  20. prism_program = stormpy.parse_prism_program(path)
  21. The `prism_program` can be translated into Markov chains::
  22. model = stormpy.build_model(program_program)
  23. print("Number of states: {}".format(model.nr_states))
  24. Building formulae
  25. --------------------------
  26. Checking properties
  27. ---------------------------