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.

39 lines
1.4 KiB

  1. from . import core
  2. from .core import *
  3. from . import storage
  4. from .storage import *
  5. from .version import __version__
  6. core._set_up("")
  7. def build_model(program, formulae):
  8. intermediate = core._build_model(program, formulae)
  9. assert not intermediate.supports_parameters
  10. if intermediate.model_type == ModelType.DTMC:
  11. return intermediate.as_dtmc()
  12. elif intermediate.model_type == ModelType.MDP:
  13. return intermediate.as_mdp()
  14. else:
  15. raise RuntimeError("Not supported non-parametric model constructed")
  16. def build_parametric_model(program, formulae):
  17. intermediate = core._build_parametric_model(program, formulae)
  18. assert intermediate.supports_parameters
  19. if intermediate.model_type == ModelType.DTMC:
  20. return intermediate.as_pdtmc()
  21. elif intermediate.model_type == ModelType.MDP:
  22. return intermediate.as_pmdp()
  23. else:
  24. raise RuntimeError("Not supported parametric model constructed")
  25. def perform_bisimulation(model, formula, bisimulation_type):
  26. if model.supports_parameters:
  27. return core._perform_parametric_bisimulation(model, formula, bisimulation_type)
  28. else:
  29. return core._perform_bisimulation(model, formula, bisimulation_type)
  30. def model_checking(model, formula):
  31. if model.supports_parameters:
  32. return core._parametric_model_checking(model, formula)
  33. else:
  34. return core._model_checking(model, formula)