Go to the documentation of this file.
15 #define TERM_ID(the_id) \
16 const irep_idt ID_smt_##the_id##_term{"smt_" #the_id "_term"};
17 #include <solvers/smt2_incremental/smt_terms.def>
32 return !(*
this == other);
55 static const std::regex valid{
"[^\\|]*"};
56 return std::regex_match(
id2string(identifier), valid);
62 std::vector<smt_indext> indices)
63 :
smt_termt(ID_smt_identifier_term, std::move(sort))
71 R
"(Identifiers may not contain | characters.)");
82 return get(ID_identifier);
85 std::vector<std::reference_wrapper<const smt_indext>>
97 :
smt_termt{ID_smt_bit_vector_constant_term, std::move(sort)}
101 "value must fit in number of bits available.");
103 !value.is_negative(),
104 "Negative numbers are not supported by bit vector constants.");
110 std::size_t bit_width)
129 std::vector<smt_termt> arguments)
130 :
smt_termt(ID_smt_function_application_term, function_identifier.get_sort())
134 std::make_move_iterator(
arguments.begin()),
135 std::make_move_iterator(
arguments.end()),
137 [](
smt_termt &&argument) {
return static_cast<irept &&
>(argument); });
146 std::vector<std::reference_wrapper<const smt_termt>>
150 return std::cref(
static_cast<const smt_termt &
>(argument));
155 std::vector<smt_identifier_termt> bound_variables,
160 !bound_variables.empty(),
161 "A forall term should bind at least one variable.");
163 std::make_move_iterator(bound_variables.begin()),
164 std::make_move_iterator(bound_variables.end()),
165 std::back_inserter(get_sub()),
167 return irept{std::move(bound_variable)};
171 "Predicate of forall quantifier is expected to have bool sort.");
172 set(ID_body, std::move(predicate));
180 std::vector<std::reference_wrapper<const smt_identifier_termt>>
189 std::vector<smt_identifier_termt> bound_variables,
194 !bound_variables.empty(),
195 "A exists term should bind at least one variable.");
197 std::make_move_iterator(bound_variables.begin()),
198 std::make_move_iterator(bound_variables.end()),
199 std::back_inserter(get_sub()),
201 return irept{std::move(bound_variable)};
205 "Predicate of exists quantifier is expected to have bool sort.");
206 set(ID_body, std::move(predicate));
214 std::vector<std::reference_wrapper<const smt_identifier_termt>>
222 template <
typename visitort>
225 #define TERM_ID(the_id) \
226 if(id == ID_smt_##the_id##_term) \
227 return visitor.visit(static_cast<const smt_##the_id##_termt &>(term));
230 #include <solvers/smt2_incremental/smt_terms.def>
242 ::accept(*
this,
id(), std::move(visitor));
#define UNREACHABLE
This should be used to mark dead code.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const smt_identifier_termt & function_identifier() const
Stores identifiers in unescaped and unquoted form.
smt_identifier_termt(irep_idt identifier, smt_sortt sort, std::vector< smt_indext > indices={})
Constructs an identifier term with the given identifier and sort.
smt_function_application_termt(smt_identifier_termt function_identifier, std::vector< smt_termt > arguments)
Unchecked construction of function application terms.
void accept(const smt_termt &term, const irep_idt &id, visitort &&visitor)
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
const irept & find(const irep_idt &name) const
static bool is_valid_smt_identifier(irep_idt identifier)
smt_forall_termt(std::vector< smt_identifier_termt > bound_variables, smt_termt predicate)
bool operator==(const smt_termt &) const
smt_bit_vector_constant_termt(const mp_integer &value, smt_bit_vector_sortt)
const smt_termt & predicate() const
const irep_idt & get(const irep_idt &name) const
static irept upcast(smt_sortt sort)
bool operator!=(const smt_termt &) const
std::vector< std::reference_wrapper< const smt_indext > > indices() const
const std::string & id2string(const irep_idt &d)
void accept(smt_term_const_downcast_visitort &) const
void set(const irep_idt &name, const irep_idt &value)
irep_idt identifier() const
const smt_sortt & get_sort() const
const irep_idt & id() 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)
const smt_termt & predicate() const
Class for adding the ability to up and down cast smt_indext to and from irept.
smt_bool_literal_termt(bool value)
bool operator==(const irept &other) const
const smt_bit_vector_sortt & get_sort() const
There are a large number of kinds of tree structured or tree-like data in CPROVER.
std::vector< std::reference_wrapper< const smt_termt > > arguments() const
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
ranget< iteratort > make_range(iteratort begin, iteratort end)
bool get_bool(const irep_idt &name) const
static const smt_sortt & downcast(const irept &)
std::vector< std::reference_wrapper< const smt_identifier_termt > > bound_variables() const