tribool SumAggrLit::accumulate(Grounder *g, const Val &weight, Lit &lit) throw(const Val*) { (void)g; int32_t num = weight.number(); if(num == 0 && !head()) return true; if(set() && !lit.testUnique(uniques_)) return true; if(lit.fact()) { fixed_ += num; if(checkUpperBound_ && fixed_ > upperBound_) return false; } else { factOnly_ = false; if(num < 0) valLower_ += num; if(num > 0) valUpper_ += num; } return lit.fact() ? tribool(true) : unknown; }
/** * \overload */ inline tribool operator!=(tribool x, indeterminate_keyword_t) { return x != tribool(indeterminate); }
/** * \overload */ inline tribool operator!=(indeterminate_keyword_t, tribool x) { return tribool(indeterminate) != x; }
/** * \overload */ inline tribool operator!=(bool x, tribool y) { return tribool(x) != y; }
/** * \overload */ inline tribool operator!=(tribool x, bool y) { return x != tribool(y); }
/** * \overload */ inline tribool operator==(tribool x, indeterminate_keyword_t) { return tribool(indeterminate) == x; }
/** * \overload */ inline tribool operator==(bool x, tribool y) { return tribool(x) == y; }
/** * \overload */ inline tribool operator==(tribool x, bool y) { return x == tribool(y); }
/** * \overload */ inline tribool operator||(tribool x, indeterminate_keyword_t) { return x? tribool(true) : tribool(indeterminate); }
/** * \overload */ inline tribool operator||(bool x, tribool y) { return x? tribool(true) : y; }
/** * \overload */ inline tribool operator||(tribool x, bool y) { return y? tribool(true) : x; }
/** * \overload */ inline tribool operator&&(tribool x, indeterminate_keyword_t) { return !x? tribool(false) : tribool(indeterminate); }
/** * \overload */ inline tribool operator&&(bool x, tribool y) { return x? y : tribool(false); }
/** * \overload */ inline tribool operator&&(tribool x, bool y) { return y? x : tribool(false); }
/** * \brief Computes the logical negation of a tribool * * \returns the logical negation of the tribool, according to the * table: * <table border=1> * <tr> * <th><center><code>!</code></center></th> * <th/> * </tr> * <tr> * <th><center>false</center></th> * <td><center>true</center></td> * </tr> * <tr> * <th><center>true</center></th> * <td><center>false</center></td> * </tr> * <tr> * <th><center>indeterminate</center></th> * <td><center>indeterminate</center></td> * </tr> * </table> * \throws nothrow */ inline tribool operator!(tribool x) { return x.value == tribool::false_value? tribool(true) :x.value == tribool::true_value? tribool(false) :tribool(indeterminate); }