GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/decision/decision_engine.cpp Lines: 20 20 100.0 %
Date: 2021-09-29 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
6328
DecisionEngine::DecisionEngine(context::Context* c, ResourceManager* rm)
26
    : d_context(c),
27
      d_resourceManager(rm),
28
      d_cnfStream(nullptr),
29
6328
      d_satSolver(nullptr)
30
{
31
6328
}
32
33
6328
void DecisionEngine::finishInit(CDCLTSatSolverInterface* ss, CnfStream* cs)
34
{
35
6328
  d_satSolver = ss;
36
6328
  d_cnfStream = cs;
37
6328
}
38
39
1867215
prop::SatLiteral DecisionEngine::getNext(bool& stopSearch)
40
{
41
1867215
  d_resourceManager->spendResource(Resource::DecisionStep);
42
1867215
  return getNextInternal(stopSearch);
43
}
44
45
1364
DecisionEngineEmpty::DecisionEngineEmpty(context::Context* sc,
46
1364
                                         ResourceManager* rm)
47
1364
    : DecisionEngine(sc, rm)
48
{
49
1364
}
50
10268
bool DecisionEngineEmpty::isDone() { return false; }
51
82714
void DecisionEngineEmpty::addAssertion(TNode assertion) {}
52
5006
void DecisionEngineEmpty::addSkolemDefinition(TNode lem, TNode skolem) {}
53
1016057
prop::SatLiteral DecisionEngineEmpty::getNextInternal(bool& stopSearch)
54
{
55
1016057
  return undefSatLiteral;
56
}
57
58
}  // namespace decision
59
22746
}  // namespace cvc5