contractor_generic_forall::contractor_generic_forall(box const & b, shared_ptr<generic_forall_constraint> const ctr)
    : contractor_cell(contractor_kind::FORALL), m_ctr(ctr) {
    m_input = ibex::BitSet::empty(b.size());
    for (Enode * var : m_ctr->get_body()->get_exist_vars()) {
        m_input.add(b.get_index(var));
    }
}
Beispiel #2
0
contractor_eval::contractor_eval(box const & box, nonlinear_constraint const * const ctr)
    : contractor_cell(contractor_kind::EVAL), m_nl_ctr(ctr) {
    // // Set up input
    auto const & var_array = m_nl_ctr->get_var_array();
    for (int i = 0; i < var_array.size(); i++) {
        m_input.add(box.get_index(var_array[i].name));
    }
}
tilingInterpolation::tilingInterpolation( box const & d,
        std::unordered_set<std::shared_ptr<constraint>> const & a_cstrs,
        std::unordered_set<std::shared_ptr<constraint>> const & b_cstrs):
    domain(d),
    a_variables(ibex::BitSet::empty(d.size())),
    b_variables(ibex::BitSet::empty(d.size())),
    a_constraints(a_cstrs),
    b_constraints(b_cstrs),
    split_stack(),
    partial_interpolants(),
    proof_size(0)
{
    for (auto c: a_cstrs) {
        for (Enode * v: c->get_vars()) {
            a_variables.add(d.get_index(v));
        }
    }
    for (auto c: b_cstrs) {
        for (Enode * v: c->get_vars()) {
            b_variables.add(d.get_index(v));
        }
    }
}
Beispiel #4
0
contractor_gsl::contractor_gsl(box const & box, shared_ptr<ode_constraint> const ctr, contractor const & eval_ctc, ode_direction const dir, double const timeout)
    : contractor_cell(contractor_kind::GSL, box.size()), m_dir(dir),
      m_ctr(ctr), m_eval_ctc(eval_ctc), m_timeout(timeout),
      m_ic(m_ctr->get_ic()), m_vars_0(m_ic.get_vars_0()), m_pars_0(m_ic.get_pars_0()),
      m_vars_t(m_ic.get_vars_t()), m_time_t(m_ic.get_time_t()),
      m_par_lhs_names(m_ic.get_par_lhs_names()), m_odes(m_ic.get_odes()),
      m_dim(m_ic.get_vars_0().size()), m_system({rhs, nullptr, m_dim, this}) {
        // Build Map
    for (unsigned i = 0; i < m_vars_0.size(); i++) {
        Enode * from = m_odes[i].first;
        m_value_lookup.emplace(from, i);
    }
    for (unsigned i = 0; i < m_pars_0.size(); i++) {
        Enode * from = m_par_lhs_names[i];
        m_param_lookup.emplace(from, i);
    }

    double const eps_abs = 1e-10;       /* absolute error requested */
    double const eps_rel = 1e-10;       /* relative error requested */

    const gsl_odeiv2_step_type * T = gsl_odeiv2_step_rk8pd;
    m_step = gsl_odeiv2_step_alloc(T, m_dim);
    m_control = gsl_odeiv2_control_y_new(eps_abs, eps_rel);
    m_evolve = gsl_odeiv2_evolve_alloc(m_dim);

    m_old_values = new double[m_dim];
    m_values = new double[m_dim];
    m_params = new double[m_pars_0.size()];

    // Input: X_0, X_T, and Time
    m_input  = ibex::BitSet::empty(box.size());
    for (Enode * e : m_ic.get_enode()->get_vars()) {
        m_input.add(box.get_index(e));
    }
    // Output: Empty
    m_output = ibex::BitSet::empty(box.size());
    m_used_constraints.insert(m_ctr);
}