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.

34 lines
1.3 KiB

  1. import stormpy
  2. class TestExpressions:
  3. def test_expression_manager(self):
  4. manager = stormpy.ExpressionManager()
  5. def test_boolean_expression(self):
  6. manager = stormpy.ExpressionManager()
  7. expression = manager.create_boolean(True)
  8. assert expression.is_literal()
  9. assert not expression.contains_variables()
  10. assert expression.has_boolean_type()
  11. assert not expression.has_integer_type()
  12. assert not expression.has_rational_type()
  13. def test_integer_expression(self):
  14. manager = stormpy.ExpressionManager()
  15. expression = manager.create_integer(2)
  16. assert expression.is_literal()
  17. assert not expression.contains_variables()
  18. assert not expression.has_boolean_type()
  19. assert expression.has_integer_type()
  20. assert not expression.has_rational_type()
  21. def test_rational_expression(self):
  22. import pycarl.gmp
  23. manager = stormpy.ExpressionManager()
  24. expression = manager.create_rational(pycarl.gmp.Rational(0.2))
  25. assert expression.is_literal()
  26. assert not expression.contains_variables()
  27. assert not expression.has_boolean_type()
  28. assert not expression.has_integer_type()
  29. assert expression.has_rational_type()