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.

33 lines
1.2 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. manager = stormpy.ExpressionManager()
  23. expression = manager.create_rational(stormpy.Rational(0.2))
  24. assert expression.is_literal()
  25. assert not expression.contains_variables()
  26. assert not expression.has_boolean_type()
  27. assert not expression.has_integer_type()
  28. assert expression.has_rational_type()