summaryrefslogtreecommitdiff
path: root/src/theory/theory_inference_manager.cpp
diff options
context:
space:
mode:
authorGereon Kremer <gkremer@stanford.edu>2021-02-11 21:25:50 +0100
committerGitHub <noreply@github.com>2021-02-11 21:25:50 +0100
commite8333750e5932ab5ce9a8a491b53aef4ffa4b0aa (patch)
treea6de942fd32afb4dcb67d33884cdff7252c6f14f /src/theory/theory_inference_manager.cpp
parentf5486884229348516ac26300273e4f5458a74208 (diff)
Make most methods of TheoryInferenceManager expect an InferenceId. (#5897)
This PR makes most methods of the TheoryInferenceManager expect an InferenceId. All classes that inherit from TheoryInferenceManager are adapted accordingly and InferenceIds are passed everywhere. In some cases, there are no appropriate InferenceIds yet. We use InferenceId::UNKNOWN for the time being and introduce proper values in future PRs. The InferenceIds are not yet used, but will be used for statistics and debug output.
Diffstat (limited to 'src/theory/theory_inference_manager.cpp')
-rw-r--r--src/theory/theory_inference_manager.cpp47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/theory/theory_inference_manager.cpp b/src/theory/theory_inference_manager.cpp
index 58a8b86a4..a56d616d9 100644
--- a/src/theory/theory_inference_manager.cpp
+++ b/src/theory/theory_inference_manager.cpp
@@ -85,7 +85,7 @@ void TheoryInferenceManager::conflictEqConstantMerge(TNode a, TNode b)
}
}
-void TheoryInferenceManager::conflict(TNode conf)
+void TheoryInferenceManager::conflict(TNode conf, InferenceId id)
{
if (!d_theoryState.isInConflict())
{
@@ -95,7 +95,7 @@ void TheoryInferenceManager::conflict(TNode conf)
}
}
-void TheoryInferenceManager::trustedConflict(TrustNode tconf)
+void TheoryInferenceManager::trustedConflict(TrustNode tconf, InferenceId id)
{
if (!d_theoryState.isInConflict())
{
@@ -104,16 +104,17 @@ void TheoryInferenceManager::trustedConflict(TrustNode tconf)
}
}
-void TheoryInferenceManager::conflictExp(PfRule id,
+void TheoryInferenceManager::conflictExp(InferenceId id,
+ PfRule pfr,
const std::vector<Node>& exp,
const std::vector<Node>& args)
{
if (!d_theoryState.isInConflict())
{
// make the trust node
- TrustNode tconf = mkConflictExp(id, exp, args);
+ TrustNode tconf = mkConflictExp(pfr, exp, args);
// send it on the output channel
- trustedConflict(tconf);
+ trustedConflict(tconf, id);
}
}
@@ -131,7 +132,8 @@ TrustNode TheoryInferenceManager::mkConflictExp(PfRule id,
return TrustNode::mkTrustConflict(conf, nullptr);
}
-void TheoryInferenceManager::conflictExp(const std::vector<Node>& exp,
+void TheoryInferenceManager::conflictExp(InferenceId id,
+ const std::vector<Node>& exp,
ProofGenerator* pg)
{
if (!d_theoryState.isInConflict())
@@ -139,7 +141,7 @@ void TheoryInferenceManager::conflictExp(const std::vector<Node>& exp,
// make the trust node
TrustNode tconf = mkConflictExp(exp, pg);
// send it on the output channel
- trustedConflict(tconf);
+ trustedConflict(tconf, id);
}
}
@@ -207,13 +209,17 @@ TrustNode TheoryInferenceManager::explainConflictEqConstantMerge(TNode a,
<< " mkTrustedConflictEqConstantMerge";
}
-bool TheoryInferenceManager::lemma(TNode lem, LemmaProperty p, bool doCache)
+bool TheoryInferenceManager::lemma(TNode lem,
+ InferenceId id,
+ LemmaProperty p,
+ bool doCache)
{
TrustNode tlem = TrustNode::mkTrustLemma(lem, nullptr);
- return trustedLemma(tlem, p, doCache);
+ return trustedLemma(tlem, id, p, doCache);
}
bool TheoryInferenceManager::trustedLemma(const TrustNode& tlem,
+ InferenceId id,
LemmaProperty p,
bool doCache)
{
@@ -230,7 +236,8 @@ bool TheoryInferenceManager::trustedLemma(const TrustNode& tlem,
}
bool TheoryInferenceManager::lemmaExp(Node conc,
- PfRule id,
+ InferenceId id,
+ PfRule pfr,
const std::vector<Node>& exp,
const std::vector<Node>& noExplain,
const std::vector<Node>& args,
@@ -238,9 +245,9 @@ bool TheoryInferenceManager::lemmaExp(Node conc,
bool doCache)
{
// make the trust node
- TrustNode trn = mkLemmaExp(conc, id, exp, noExplain, args);
+ TrustNode trn = mkLemmaExp(conc, pfr, exp, noExplain, args);
// send it on the output channel
- return trustedLemma(trn, p, doCache);
+ return trustedLemma(trn, id, p, doCache);
}
TrustNode TheoryInferenceManager::mkLemmaExp(Node conc,
@@ -261,6 +268,7 @@ TrustNode TheoryInferenceManager::mkLemmaExp(Node conc,
}
bool TheoryInferenceManager::lemmaExp(Node conc,
+ InferenceId id,
const std::vector<Node>& exp,
const std::vector<Node>& noExplain,
ProofGenerator* pg,
@@ -270,7 +278,7 @@ bool TheoryInferenceManager::lemmaExp(Node conc,
// make the trust node
TrustNode trn = mkLemmaExp(conc, exp, noExplain, pg);
// send it on the output channel
- return trustedLemma(trn, p, doCache);
+ return trustedLemma(trn, id, p, doCache);
}
TrustNode TheoryInferenceManager::mkLemmaExp(Node conc,
@@ -305,23 +313,28 @@ bool TheoryInferenceManager::hasSentLemma() const
return d_numCurrentLemmas != 0;
}
-bool TheoryInferenceManager::assertInternalFact(TNode atom, bool pol, TNode exp)
+bool TheoryInferenceManager::assertInternalFact(TNode atom,
+ bool pol,
+ InferenceId id,
+ TNode exp)
{
return processInternalFact(atom, pol, PfRule::UNKNOWN, {exp}, {}, nullptr);
}
bool TheoryInferenceManager::assertInternalFact(TNode atom,
bool pol,
- PfRule id,
+ InferenceId id,
+ PfRule pfr,
const std::vector<Node>& exp,
const std::vector<Node>& args)
{
- Assert(id != PfRule::UNKNOWN);
- return processInternalFact(atom, pol, id, exp, args, nullptr);
+ Assert(pfr != PfRule::UNKNOWN);
+ return processInternalFact(atom, pol, pfr, exp, args, nullptr);
}
bool TheoryInferenceManager::assertInternalFact(TNode atom,
bool pol,
+ InferenceId id,
const std::vector<Node>& exp,
ProofGenerator* pg)
{
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback