diff options
author | mudathirmahgoub <mudathirmahgoub@gmail.com> | 2021-01-25 14:38:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-25 14:38:45 -0600 |
commit | eaad5bdc7a38fcc38baa0e3b73f6c39a0ec6fb05 (patch) | |
tree | 42452e177fa8a24a523ce715aa3a40a99644ab17 /src/theory/bags/infer_info.cpp | |
parent | 7f851ea2e2b40f7e5d6e0c0fbe4e9c6ea0450209 (diff) |
Refactor bags::SolverState (#5783)
Couple of changes:
SolverState now keep tracks of elements per bag instead of per type.
bags::InferInfo now stores multiple conclusions (conjuncts).
BagSolver applies upward/downward closures for bag elements
Diffstat (limited to 'src/theory/bags/infer_info.cpp')
-rw-r--r-- | src/theory/bags/infer_info.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/theory/bags/infer_info.cpp b/src/theory/bags/infer_info.cpp index 1244a43ac..5b3274617 100644 --- a/src/theory/bags/infer_info.cpp +++ b/src/theory/bags/infer_info.cpp @@ -25,6 +25,8 @@ const char* toString(Inference i) switch (i) { case Inference::NONE: return "NONE"; + case Inference::BAG_NON_NEGATIVE_COUNT: return "BAG_NON_NEGATIVE_COUNT"; + case Inference::BAG_MK_BAG_SAME_ELEMENT: return "BAG_MK_BAG_SAME_ELEMENT"; case Inference::BAG_MK_BAG: return "BAG_MK_BAG"; case Inference::BAG_EQUALITY: return "BAG_EQUALITY"; case Inference::BAG_DISEQUALITY: return "BAG_DISEQUALITY"; @@ -62,9 +64,19 @@ bool InferInfo::process(TheoryInferenceManager* im, bool asLemma) if (asLemma) { TrustNode trustedLemma = TrustNode::mkTrustLemma(lemma, nullptr); - return im->trustedLemma(trustedLemma); + im->trustedLemma(trustedLemma); } - Unimplemented(); + else + { + Unimplemented(); + } + for (const auto& pair : d_skolems) + { + Node n = pair.first.eqNode(pair.second); + TrustNode trustedLemma = TrustNode::mkTrustLemma(n, nullptr); + im->trustedLemma(trustedLemma); + } + return true; } bool InferInfo::isTrivial() const @@ -87,21 +99,15 @@ bool InferInfo::isFact() const return !atom.isConst() && atom.getKind() != kind::OR; } -Node InferInfo::getPremises() const -{ - // d_noExplain is a subset of d_ant - NodeManager* nm = NodeManager::currentNM(); - return nm->mkAnd(d_premises); -} - std::ostream& operator<<(std::ostream& out, const InferInfo& ii) { - out << "(infer " << ii.d_id << " " << ii.d_conclusion << std::endl; + out << "(infer :id " << ii.d_id << std::endl; + out << ":conclusion " << ii.d_conclusion << std::endl; if (!ii.d_premises.empty()) { out << " :premise (" << ii.d_premises << ")" << std::endl; } - + out << ":skolems " << ii.d_skolems << std::endl; out << ")"; return out; } |