void context::display_subexprs_info(std::ostream & out, expr * n) const { ptr_buffer<expr> todo; todo.push_back(n); while (!todo.empty()) { expr * n = todo.back(); todo.pop_back(); out << "#"; out.width(6); out << std::left << n->get_id(); out << ", relevant: " << is_relevant(n); if (m_manager.is_bool(n)) { out << ", val: "; out.width(7); out << std::right; if (lit_internalized(n)) out << get_assignment(n); else out << "l_undef"; } if (e_internalized(n)) { enode * e = get_enode(n); out << ", root: #" << e->get_root()->get_owner_id(); } out << "\n"; if (is_app(n)) { for (unsigned i = 0; i < to_app(n)->get_num_args(); i++) todo.push_back(to_app(n)->get_arg(i)); } } }
/** \brief Display enode definitions #n := (f #i_1 ... #i_n), where #i_k is the root of the k-th argument of the enode #n. */ void context::display_normalized_enodes(std::ostream & out) const { out << "normalized enodes:\n"; ptr_vector<enode>::const_iterator it = m_enodes.begin(); ptr_vector<enode>::const_iterator end = m_enodes.end(); for (; it != end; ++it) { enode * n = *it; out << "#"; out.width(5); out << std::left << n->get_owner_id() << " #"; out.width(5); out << n->get_root()->get_owner_id() << " := " << std::right; unsigned num = n->get_owner()->get_num_args(); if (num > 0) out << "("; out << n->get_decl()->get_name(); if (!n->get_decl()->private_parameters()) display_parameters(out, n->get_decl()->get_num_parameters(), n->get_decl()->get_parameters()); for (unsigned i = 0; i < num; i++) { expr * arg = n->get_owner()->get_arg(i); if (e_internalized(arg)) { enode * n = get_enode(arg)->get_root(); out << " #" << n->get_owner_id(); } else { out << " #" << arg->get_id(); } } if (num > 0) out << ")"; if (is_relevant(n)) out << "\t*"; out << "\n"; } }
ostream & forall_constraint::display(ostream & out) const { out << "forall([ "; for (Enode * const var : m_forall_vars) { out << var << " "; } out << "], " << (m_polarity == l_True ? "" : "!") << get_enode() << ")" << endl; return out; }
ostream & forallt_constraint::display(ostream & out) const { out << "forallt_constraint = " << get_enode() << endl; out << "\t" << "flow_id = " << m_flow_id << endl; out << "\t" << "time = [" << m_time_0 << "," << m_time_t << "]" << endl; out << "\t" << "inv : " << m_inv << endl; return out; }
void nonlinear_constraint::build_maps() const { std::thread::id const tid = std::this_thread::get_id(); assert(m_numctr_map.find(tid) == m_numctr_map.cend()); assert(m_var_array_map.find(tid) == m_var_array_map.cend()); // Build var_array_map map<string, ibex::ExprSymbol const *> var_map = build_var_map(m_domain_vars); ibex::Array<ibex::ExprSymbol const> & var_array = m_var_array_map[tid]; var_array.resize(var_map.size()); int i = 0; for (auto const item : var_map) { var_array.set_ref(i++, *(item.second)); } // The use of unique_ptr is to free the returned exprctr* from translate_enode_to_exprctr unique_ptr<ibex::ExprCtr const> exprctr( translate_enode_to_exprctr(var_map, get_enode(), m_polarity, m_subst)); m_numctr_map[tid].reset(new ibex::NumConstraint(var_array, *exprctr)); }
ostream & integral_constraint::display(ostream & out) const { out << "integral_constraint = " << get_enode() << endl; out << "\t" << "flow_id = " << m_flow_id << endl; out << "\t" << "time = [" << m_time_0 << "," << m_time_t << "]" << endl; for (unsigned i = 0; i < m_pars_0.size(); ++i) { out << "\t" << "par: " << m_pars_0[i] << " " << m_pars_t[i] << endl; } for (unsigned i = 0; i < m_vars_0.size(); ++i) { out << "\t" << "var: " << m_vars_0[i] << " " << m_vars_t[i] << endl; } for (auto const & ode : m_odes) { out << "\t" << "d/dt[" << ode.first << "] = " << ode.second << endl; } return out; }