GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/decision/decision_engine.cpp Lines: 20 20 100.0 %
Date: 2021-09-18 Branches: 2 4 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Kshitij Bansal, Aina Niemetz, Andrew Reynolds
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Decision engine.
14
 */
15
#include "decision/decision_engine.h"
16
17
#include "decision/decision_engine_old.h"
18
#include "options/decision_options.h"
19
#include "prop/sat_solver.h"
20
#include "util/resource_manager.h"
21
22
namespace cvc5 {
23
namespace decision {
24
25
10007
DecisionEngine::DecisionEngine(context::Context* c, ResourceManager* rm)
26
    : d_context(c),
27
      d_resourceManager(rm),
28
      d_cnfStream(nullptr),
29
10007
      d_satSolver(nullptr)
30
{
31
10007
}
32
33
10007
void DecisionEngine::finishInit(CDCLTSatSolverInterface* ss, CnfStream* cs)
34
{
35
10007
  d_satSolver = ss;
36
10007
  d_cnfStream = cs;
37
10007
}
38
39
2733866
prop::SatLiteral DecisionEngine::getNext(bool& stopSearch)
40
{
41
2733866
  d_resourceManager->spendResource(Resource::DecisionStep);
42
2733866
  return getNextInternal(stopSearch);
43
}
44
45
2252
DecisionEngineEmpty::DecisionEngineEmpty(context::Context* sc,
46
2252
                                         ResourceManager* rm)
47
2252
    : DecisionEngine(sc, rm)
48
{
49
2252
}
50
14470
bool DecisionEngineEmpty::isDone() { return false; }
51
122627
void DecisionEngineEmpty::addAssertion(TNode assertion) {}
52
7279
void DecisionEngineEmpty::addSkolemDefinition(TNode lem, TNode skolem) {}
53
1427272
prop::SatLiteral DecisionEngineEmpty::getNextInternal(bool& stopSearch)
54
{
55
1427272
  return undefSatLiteral;
56
}
57
58
}  // namespace decision
59
29574
}  // namespace cvc5