5 const auto& cLHS = constraint.lhs();
6 carl::Relation cRel = constraint.relation();
7 std::set<carl::Variable> cVars = constraint.variables().as_set();
8 Rational cRHS = -constraint.lhs().constant_part();
13 for(
const auto& it : cLHS){
14 if (it.is_constant())
continue;
18 }
else if(it.coeff() > 0){
24 if(positive && cRel == carl::Relation::LEQ){
27 return FormulaT(carl::FormulaType::FALSE);
29 if(cRel == carl::Relation::LEQ){
35 return FormulaT(carl::FormulaType::FALSE);
38 if(sum == cRHS && cRel == carl::Relation::LEQ){
40 return FormulaT(carl::FormulaType::TRUE);
41 }
else if(sum == cRHS && cRel == carl::Relation::LESS){
47 return FormulaT(carl::FormulaType::TRUE);
50 }
else if(negative && cRel == carl::Relation::LEQ){
53 return FormulaT(carl::FormulaType::TRUE);
55 if(cRel == carl::Relation::LEQ){
57 return FormulaT(carl::FormulaType::TRUE);
65 return FormulaT(carl::FormulaType::FALSE);
66 }
else if(sum == cRHS && cRel == carl::Relation::LEQ){
70 }
else if(sum == cRHS && cRel == carl::Relation::LESS){
72 return FormulaT(carl::FormulaType::FALSE);
79 }
else if(sum != cRHS && cRHS == 0){
84 }
else if(cRel == carl::Relation::NEQ){
85 if(sum != cRHS && cRHS == 0){
100 for (
const auto& term : constraint.lhs()) {
101 if (term.is_constant())
continue;
107 if (term.coeff() > 0) {
109 }
else if (term.coeff() < 0) {
114 return positive != negative && !onlyOnes;
virtual Rational encodingSize(const ConstraintT &constraint)
FormulaT generateVarChain(const std::set< carl::Variable > &vars, carl::FormulaType type)
Numeric abs(const Numeric &_value)
Calculates the absolute value of the given Numeric.
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::Constraint< Poly > ConstraintT