Beispiel #1
0
/**
   \brief Simple function that tries to prove the given conjecture using the following steps:
   1- create a solver
   2- assert the negation of the conjecture
   3- checks if the result is unsat.
*/
void prove(expr conjecture) {
    context & c = conjecture.ctx();
    solver s(c);
    s.add(!conjecture);
    std::cout << "conjecture:\n" << conjecture << "\n";
    if (s.check() == unsat) {
        std::cout << "proved" << "\n";
    }
    else {
        std::cout << "failed to prove" << "\n";
        std::cout << "counterexample:\n" << s.get_model() << "\n";
    }
}
Beispiel #2
0
inline bool IsValid(expr term) {
    solver s{term.ctx()};
    s.add(!term);
    return s.check() == unsat;
}
Beispiel #3
0
inline bool IsSatisfiable(expr term) {
    solver s{term.ctx()};
    s.add(term);
    return s.check() == sat;
}