7 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SORTS_H
8 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SORTS_H
13 #include <type_traits>
37 template <
typename derivedt>
46 template <
typename sub_
classt>
47 const sub_classt *
cast() const &;
49 template <typename sub_classt>
50 std::optional<sub_classt>
cast() &&;
56 template <typename derivedt>
60 std::is_base_of<irept, derivedt>::value &&
62 "Only irept based classes need to upcast smt_sortt to store it.");
65 template <
typename derivedt>
68 return static_cast<irept &&
>(std::move(sort));
71 template <
typename derivedt>
74 return static_cast<const smt_sortt &
>(irep);
87 std::size_t bit_width()
const;
103 #define SORT_ID(the_id) virtual void visit(const smt_##the_id##_sortt &) = 0;
104 #include "smt_sorts.def"
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
Class for adding the ability to up and down cast smt_sortt to and from irept.
static irept upcast(smt_sortt sort)
static const smt_sortt & downcast(const irept &)
const sub_classt * cast() const &
bool operator==(const smt_sortt &) const
bool operator!=(const smt_sortt &) const
void accept(smt_sort_const_downcast_visitort &) const