summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorGereon Kremer <nafur42@gmail.com>2021-08-16 07:20:22 -0700
committerGitHub <noreply@github.com>2021-08-16 14:20:22 +0000
commit5e31ee3a34388d6d44129e898897bdb1297009de (patch)
treeb12a86a3737c23555444d2ed6c5c3f13b737b7a4 /test/unit
parent0711ec521f01888b059d152d1c1f20382d5ce432 (diff)
Make Theory class use Env (#7011)
This PR changes the Theory base class and the constructors of all theories to use the Env class to access contexts, logic information and the proof node manager.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_smt.h11
-rw-r--r--test/unit/theory/theory_white.cpp15
2 files changed, 5 insertions, 21 deletions
diff --git a/test/unit/test_smt.h b/test/unit/test_smt.h
index 4226f8095..c27c02925 100644
--- a/test/unit/test_smt.h
+++ b/test/unit/test_smt.h
@@ -206,14 +206,9 @@ template <theory::TheoryId theoryId>
class DummyTheory : public theory::Theory
{
public:
- DummyTheory(context::Context* ctxt,
- context::UserContext* uctxt,
- theory::OutputChannel& out,
- theory::Valuation valuation,
- const LogicInfo& logicInfo,
- ProofNodeManager* pnm)
- : Theory(theoryId, ctxt, uctxt, out, valuation, logicInfo, pnm),
- d_state(ctxt, uctxt, valuation)
+ DummyTheory(Env& env, theory::OutputChannel& out, theory::Valuation valuation)
+ : Theory(theoryId, env, out, valuation),
+ d_state(getSatContext(), getUserContext(), valuation)
{
// use a default theory state object
d_theoryState = &d_state;
diff --git a/test/unit/theory/theory_white.cpp b/test/unit/theory/theory_white.cpp
index 94021a9e3..915b469db 100644
--- a/test/unit/theory/theory_white.cpp
+++ b/test/unit/theory/theory_white.cpp
@@ -37,30 +37,19 @@ class TestTheoryWhite : public TestSmtNoFinishInit
void SetUp() override
{
TestSmtNoFinishInit::SetUp();
- d_context = d_smtEngine->getContext();
- d_user_context = d_smtEngine->getUserContext();
- d_logicInfo.reset(new LogicInfo());
- d_logicInfo->lock();
d_smtEngine->finishInit();
delete d_smtEngine->getTheoryEngine()->d_theoryTable[THEORY_BUILTIN];
delete d_smtEngine->getTheoryEngine()->d_theoryOut[THEORY_BUILTIN];
d_smtEngine->getTheoryEngine()->d_theoryTable[THEORY_BUILTIN] = nullptr;
d_smtEngine->getTheoryEngine()->d_theoryOut[THEORY_BUILTIN] = nullptr;
- d_dummy_theory.reset(new DummyTheory<THEORY_BUILTIN>(d_context,
- d_user_context,
- d_outputChannel,
- Valuation(nullptr),
- *d_logicInfo,
- nullptr));
+ d_dummy_theory.reset(new DummyTheory<THEORY_BUILTIN>(
+ d_smtEngine->getEnv(), d_outputChannel, Valuation(nullptr)));
d_outputChannel.clear();
d_atom0 = d_nodeManager->mkConst(true);
d_atom1 = d_nodeManager->mkConst(false);
}
- Context* d_context;
- UserContext* d_user_context;
- std::unique_ptr<LogicInfo> d_logicInfo;
DummyOutputChannel d_outputChannel;
std::unique_ptr<DummyTheory<THEORY_BUILTIN>> d_dummy_theory;
Node d_atom0;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback