blob: 4116ba90d6986caa9b016679bc2b3d618b058516 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/******************************************************************************
* Top contributors (to current version):
* Kshitij Bansal, Aina Niemetz, Andrew Reynolds
*
* This file is part of the cvc5 project.
*
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
* in the top-level source directory and their institutional affiliations.
* All rights reserved. See the file COPYING in the top-level source
* directory for licensing information.
* ****************************************************************************
*
* Decision engine.
*/
#include "decision/decision_engine.h"
#include "decision/decision_engine_old.h"
#include "options/decision_options.h"
#include "prop/sat_solver.h"
#include "util/resource_manager.h"
namespace cvc5 {
namespace decision {
DecisionEngine::DecisionEngine(context::Context* c,
context::UserContext* u,
prop::SkolemDefManager* skdm,
ResourceManager* rm)
: d_decEngineOld(new DecisionEngineOld(c, u)),
d_resourceManager(rm),
d_useOld(true)
{
}
void DecisionEngine::finishInit(prop::CDCLTSatSolverInterface* ss,
prop::CnfStream* cs)
{
if (d_useOld)
{
d_decEngineOld->setSatSolver(ss);
d_decEngineOld->setCnfStream(cs);
return;
}
}
void DecisionEngine::presolve() {}
prop::SatLiteral DecisionEngine::getNext(bool& stopSearch)
{
d_resourceManager->spendResource(Resource::DecisionStep);
if (d_useOld)
{
return d_decEngineOld->getNext(stopSearch);
}
return undefSatLiteral;
}
bool DecisionEngine::isDone()
{
if (d_useOld)
{
return d_decEngineOld->isDone();
}
return false;
}
void DecisionEngine::addAssertion(TNode assertion)
{
if (d_useOld)
{
d_decEngineOld->addAssertion(assertion);
return;
}
}
void DecisionEngine::addSkolemDefinition(TNode lem, TNode skolem)
{
if (d_useOld)
{
d_decEngineOld->addSkolemDefinition(lem, skolem);
}
}
void DecisionEngine::notifyAsserted(TNode n)
{
if (d_useOld)
{
return;
}
}
} // namespace decision
} // namespace cvc5
|