6 template<
typename Solver>
13 for (
auto it = mSolver.formulaBegin(); it != mSolver.formulaEnd(); ++it) {
14 if (it->formula() == formula) {
18 assert(
false &&
"Formula was not added correctly to backend. Expected to find formula.");
19 return mSolver.formulaEnd();
23 MaxSMTBackend(Solver& solver,
const std::vector<FormulaT>& softClauses) : mSolver(solver), softClauses(softClauses) {}
31 std::vector<carl::Variable> relaxationVars;
32 for (
const auto& clause : softClauses) {
33 carl::Variable relaxationVar = carl::fresh_boolean_variable();
36 relaxationVars.push_back(relaxationVar);
40 for (carl::Variable&
var : relaxationVars) {
41 relaxationPoly = relaxationPoly +
var;
48 for (
unsigned i = 1; i < softClauses.size(); i++) {
49 SMTRAT_LOG_DEBUG(
"smtrat.maxsmt.linear",
"Trying to check SAT for " << (i - 1) <<
" disabled soft constraints...");
51 Answer ans = mSolver.check();
54 std::cout <<
"REMOVE " << previousRelaxationConstraint->formula() << std::endl;
56 mSolver.remove(previousRelaxationConstraint);
59 previousRelaxationConstraint = addToSolver(
FormulaT(relaxationConstraint));
ModuleInput::iterator addToSolver(const FormulaT &formula)
MaxSMTBackend(Solver &solver, const std::vector< FormulaT > &softClauses)
const std::vector< FormulaT > & softClauses
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::MultivariatePolynomial< Rational > Poly
Answer
An enum with the possible answers a Module can give.
carl::Constraint< Poly > ConstraintT
#define SMTRAT_LOG_DEBUG(channel, msg)