15 #define TERM_ID(the_id) \
16 const irep_idt ID_smt_##the_id##_term{"smt_" #the_id "_term"};
17 #include "smt_terms.def"
22 :
irept{id, {{ID_type,
upcast(std::move(sort))}}, {}}
33 return !(*
this == other);
56 static const std::regex valid{
"[^\\|]*"};
57 return std::regex_match(
id2string(identifier), valid);
63 std::vector<smt_indext> indices)
64 :
smt_termt(ID_smt_identifier_term, std::move(sort))
72 R
"(Identifiers may not contain | characters.)");
83 return get(ID_identifier);
86 std::vector<std::reference_wrapper<const smt_indext>>
98 :
smt_termt{ID_smt_bit_vector_constant_term, std::move(sort)}
102 "value must fit in number of bits available.");
104 !
value.is_negative(),
105 "Negative numbers are not supported by bit vector constants.");
111 std::size_t bit_width)
130 std::vector<smt_termt> arguments)
131 :
smt_termt(ID_smt_function_application_term, function_identifier.get_sort())
135 std::make_move_iterator(
arguments.begin()),
136 std::make_move_iterator(
arguments.end()),
138 [](
smt_termt &&argument) {
return static_cast<irept &&
>(argument); });
147 std::vector<std::reference_wrapper<const smt_termt>>
151 return std::cref(
static_cast<const smt_termt &
>(argument));
156 std::vector<smt_identifier_termt> bound_variables,
162 "A forall term should bind at least one variable.");
168 return irept{std::move(bound_variable)};
172 "Predicate of forall quantifier is expected to have bool sort.");
181 std::vector<std::reference_wrapper<const smt_identifier_termt>>
190 std::vector<smt_identifier_termt> bound_variables,
196 "A exists term should bind at least one variable.");
202 return irept{std::move(bound_variable)};
206 "Predicate of exists quantifier is expected to have bool sort.");
215 std::vector<std::reference_wrapper<const smt_identifier_termt>>
223 template <
typename visitort>
226 #define TERM_ID(the_id) \
227 if(id == ID_smt_##the_id##_term) \
228 return visitor.visit(static_cast<const smt_##the_id##_termt &>(term));
231 #include "smt_terms.def"
243 ::accept(*
this,
id(), std::move(visitor));
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
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.
bool get_bool(const irep_idt &name) const
bool operator==(const irept &other) const
const irept & find(const irep_idt &name) const
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const smt_bit_vector_sortt & get_sort() const
smt_bit_vector_constant_termt(const mp_integer &value, smt_bit_vector_sortt)
std::size_t bit_width() const
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
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.
static irept upcast(smt_sortt sort)
static const smt_sortt & downcast(const irept &)
const sub_classt * cast() const &
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
const std::string & id2string(const irep_idt &d)
Ranges: pair of begin and end iterators, which can be initialized from containers,...
ranget< iteratort > make_range(iteratort begin, iteratort end)
Data structure for smt sorts.
void accept(const smt_termt &term, const irep_idt &id, visitort &&visitor)
static bool is_valid_smt_identifier(irep_idt identifier)
#define UNREACHABLE
This should be used to mark dead code.