3 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_TERMS_H
4 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_TERMS_H
42 template <
typename derivedt>
55 template <
typename derivedt>
59 std::is_base_of<irept, derivedt>::value &&
61 "Only irept based classes need to upcast smt_termt to store it.");
64 template <
typename derivedt>
67 return static_cast<irept &&
>(std::move(term));
70 template <
typename derivedt>
73 return static_cast<const smt_termt &
>(irep);
111 std::vector<smt_indext>
indices = {});
113 std::vector<std::reference_wrapper<const smt_indext>>
indices()
const;
144 template <
class functiont,
class =
void>
149 template <
class functiont>
152 std::void_t<decltype(std::declval<functiont>().indices())>> : std::true_type
158 template <
class functiont>
162 return function.indices();
169 std::vector<std::reference_wrapper<const smt_termt>>
arguments()
const;
171 template <
typename functiont>
178 template <
typename... function_type_argument_typest>
180 :
function{std::forward<function_type_argument_typest>(
arguments)...}
184 template <
typename... argument_typest>
189 auto return_sort =
function.return_sort(
arguments...);
193 {std::forward<argument_typest>(
arguments)...}};
196 template <
typename... argument_typest>
200 const auto validation_errors =
function.validation_errors(
arguments...);
201 if(!validation_errors.empty())
203 auto return_sort =
function.return_sort(
arguments...);
207 {std::forward<argument_typest>(
arguments)...}}};
218 std::vector<std::reference_wrapper<const smt_identifier_termt>>
229 std::vector<std::reference_wrapper<const smt_identifier_termt>>
237 #define TERM_ID(the_id) virtual void visit(const smt_##the_id##_termt &) = 0;
238 #include "smt_terms.def"
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Holds either a valid parsed response or response sub-tree of type.
const smt_bit_vector_sortt & get_sort() const
smt_bit_vector_constant_termt(const mp_integer &value, smt_bit_vector_sortt)
smt_bool_literal_termt(bool value)
const smt_termt & predicate() const
std::vector< std::reference_wrapper< const smt_identifier_termt > > bound_variables() const
smt_exists_termt(std::vector< smt_identifier_termt > bound_variables, smt_termt predicate)
smt_forall_termt(std::vector< smt_identifier_termt > bound_variables, smt_termt predicate)
const smt_termt & predicate() const
std::vector< std::reference_wrapper< const smt_identifier_termt > > bound_variables() const
factoryt(function_type_argument_typest &&...arguments) noexcept
smt_function_application_termt operator()(argument_typest &&...arguments) const
response_or_errort< smt_termt > validation(argument_typest &&...arguments) const
static std::vector< smt_indext > indices(const functiont &function)
Returns function.indices() if functiont has an indices member function or returns an empty collection...
const smt_identifier_termt & function_identifier() const
smt_function_application_termt(smt_identifier_termt function_identifier, std::vector< smt_termt > arguments)
Unchecked construction of function application terms.
std::vector< std::reference_wrapper< const smt_termt > > arguments() const
Stores identifiers in unescaped and unquoted form.
irep_idt identifier() const
smt_identifier_termt(irep_idt identifier, smt_sortt sort, std::vector< smt_indext > indices={})
Constructs an identifier term with the given identifier and sort.
std::vector< std::reference_wrapper< const smt_indext > > indices() const
Class for adding the ability to up and down cast smt_indext to and from irept.
Class for adding the ability to up and down cast smt_sortt to and from irept.
Class for adding the ability to up and down cast smt_termt to and from irept.
static irept upcast(smt_termt term)
static const smt_termt & downcast(const irept &)
const smt_sortt & get_sort() const
bool operator==(const smt_termt &) const
void accept(smt_term_const_downcast_visitort &) const
bool operator!=(const smt_termt &) const
Data structure for smt sorts.