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.

29 lines
1.3 KiB

  1. import stormpy
  2. import stormpy.logic
  3. from helpers.helper import get_example_path
  4. class TestParametric:
  5. def test_constraints_collector(self):
  6. #TODO decide whether we have CLN or GMP based on some flag in stormpy.
  7. import pycarl
  8. import pycarl.cln
  9. import pycarl.gmp
  10. from pycarl.formula import FormulaType, Relation
  11. import pycarl.cln.formula
  12. import pycarl.gmp.formula
  13. program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm"))
  14. prop = "P=? [F s=5]"
  15. formulas = stormpy.parse_properties_for_prism_program(prop, program)
  16. model = stormpy.build_parametric_model(program, formulas)
  17. collector = stormpy.ConstraintCollector(model)
  18. constraints_well_formed = collector.wellformed_constraints
  19. for formula in constraints_well_formed:
  20. assert formula.type == FormulaType.CONSTRAINT
  21. constraint = formula.get_constraint()
  22. assert constraint.relation == Relation.LEQ
  23. constraints_graph_preserving = collector.graph_preserving_constraints
  24. for formula in constraints_graph_preserving:
  25. assert formula.type == FormulaType.CONSTRAINT
  26. constraint = formula.get_constraint()
  27. assert constraint.relation == Relation.NEQ