13 #ifndef CPROVER_TESTING_UTILS_EXPR_QUERY_H
14 #define CPROVER_TESTING_UTILS_EXPR_QUERY_H
22 template <
typename T = exprt>
26 std::is_base_of<exprt, T>::value,
27 "T should inherit from exprt");
34 template <
typename targett>
37 auto result = expr_try_dynamic_cast<targett>(
static_cast<exprt>(
value));
44 REQUIRE(
value.operands().size() > i);
Wrapper for std::optional<exprt> with useful method for queries to be used in unit tests.
expr_queryt< exprt > operator[](const std::size_t i) const
expr_queryt< targett > as() const
Base class for all expressions.
Templated functions to cast to specific exprt-derived classes.
expr_queryt< exprt > make_query(exprt e)