Esempio n. 1
0
// Prune a given box b using ctc, but keep the old state of ctc
void test_prune(box & b, contractor & ctc, SMTConfig & config) {
    try {
        auto const old_output = ctc.output();
        auto const old_used_constraints = ctc.used_constraints();
        ctc.prune(b, config);
        ctc.set_output(old_output);
        ctc.set_used_constraints(old_used_constraints);
    } catch (contractor_exception & e) {
        // Do nothing
    }
}
Esempio n. 2
0
    integral_constraint ic(static_cast<Enode*>(assert5), 1,
                           static_cast<Enode*>(zero),
                           static_cast<Enode*>(time_0),
                           {static_cast<Enode*>(x_0), static_cast<Enode*>(p_0)}, {},
                           {static_cast<Enode*>(x_t), static_cast<Enode*>(p_t)}, {},
                           {},
                           {make_pair(static_cast<Enode*>(vars[0]), static_cast<Enode*>(rhs_x)),
                            make_pair(static_cast<Enode*>(vars[1]), static_cast<Enode*>(rhs_p))});
    auto oc = make_shared<ode_constraint>(ic);

    contractor c = mk_contractor_capd_full(b, oc, ode_direction::FWD);

    cerr << *oc << endl;
    cerr << b << endl;
    auto input_before = c.input();
    auto output_before = c.output();
    cerr << "Input  (BEFORE) : ";  input_before.display(cerr) << endl;
    cerr << "Output (BEFORE) : "; output_before.display(cerr) << endl;
    c.prune(b, opensmt_ctx->getConfig());
    cerr << b << endl;
    auto input_after = c.input();
    auto output_after = c.output();
    cerr << "Input  (AFTER)  : ";  input_after.display(cerr) << endl;
    cerr << "Output (AFTER)  : "; output_after.display(cerr) << endl;
    for (auto ctc : c.used_constraints()) {
        cerr << "Used constraint : " << *ctc << endl;
    }

    REQUIRE(!input_after[0]);
    REQUIRE(input_after[1]);
    REQUIRE(input_after[2]);