//! Returns the truth value that is currently assigned to lit or Value_t::Free if lit is unassigned. virtual Value_t value(Lit_t lit) const { CLASP_FAIL_IF(!this->TheoryPropagator::PP::hasLit(lit), "invalid variable"); switch (solver_->value(decodeVar(lit))) { default: return Value_t::Free; case value_true: return lit >= 0 ? Value_t::True : Value_t::False; case value_false: return lit >= 0 ? Value_t::False : Value_t::True; } }
ClingoAssignment::Value_t ClingoAssignment::value(Lit_t lit) const { POTASSCO_REQUIRE(ClingoAssignment::hasLit(lit), "Invalid literal"); switch (solver_->value(decodeVar(lit))) { default: return Value_t::Free; case value_true: return lit >= 0 ? Value_t::True : Value_t::False; case value_false: return lit >= 0 ? Value_t::False : Value_t::True; } }
virtual uint32_t level(Lit_t lit) const { return value(lit) != Potassco::Value_t::Free ? solver_->level(decodeVar(lit)) : uint32_t(-1); }
virtual bool hasLit(Lit_t lit) const { return solver_->validVar(decodeVar(lit)); }
bool ClingoAssignment::hasLit(Lit_t lit) const { return solver_->validVar(decodeVar(lit)); }
uint32_t ClingoAssignment::level(Lit_t lit) const { return ClingoAssignment::value(lit) != Potassco::Value_t::Free ? solver_->level(decodeVar(lit)) : UINT32_MAX; }