GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/quantifiers_modules.cpp Lines: 44 44 100.0 %
Date: 2021-05-22 Branches: 59 92 64.1 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner
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
 * Class for initializing the modules of quantifiers engine.
14
 */
15
16
#include "theory/quantifiers/quantifiers_modules.h"
17
18
#include "options/quantifiers_options.h"
19
#include "theory/quantifiers/relevant_domain.h"
20
#include "theory/quantifiers/term_registry.h"
21
22
namespace cvc5 {
23
namespace theory {
24
namespace quantifiers {
25
26
6414
QuantifiersModules::QuantifiersModules()
27
    : d_rel_dom(nullptr),
28
      d_alpha_equiv(nullptr),
29
      d_inst_engine(nullptr),
30
      d_model_engine(nullptr),
31
      d_bint(nullptr),
32
      d_qcf(nullptr),
33
      d_sg_gen(nullptr),
34
      d_synth_e(nullptr),
35
      d_fs(nullptr),
36
      d_ipool(nullptr),
37
      d_i_cbqi(nullptr),
38
      d_qsplit(nullptr),
39
6414
      d_sygus_inst(nullptr)
40
{
41
6414
}
42
6414
QuantifiersModules::~QuantifiersModules() {}
43
6414
void QuantifiersModules::initialize(QuantifiersState& qs,
44
                                    QuantifiersInferenceManager& qim,
45
                                    QuantifiersRegistry& qr,
46
                                    TermRegistry& tr,
47
                                    QModelBuilder* builder,
48
                                    std::vector<QuantifiersModule*>& modules)
49
{
50
  // add quantifiers modules
51
6414
  if (options::quantConflictFind())
52
  {
53
4620
    d_qcf.reset(new QuantConflictFind(qs, qim, qr, tr));
54
4620
    modules.push_back(d_qcf.get());
55
  }
56
6414
  if (options::conjectureGen())
57
  {
58
10
    d_sg_gen.reset(new ConjectureGenerator(qs, qim, qr, tr));
59
10
    modules.push_back(d_sg_gen.get());
60
  }
61
6414
  if (!options::finiteModelFind() || options::fmfInstEngine())
62
  {
63
6158
    d_inst_engine.reset(new InstantiationEngine(qs, qim, qr, tr));
64
6158
    modules.push_back(d_inst_engine.get());
65
  }
66
6414
  if (options::cegqi())
67
  {
68
6323
    d_i_cbqi.reset(new InstStrategyCegqi(qs, qim, qr, tr));
69
6323
    modules.push_back(d_i_cbqi.get());
70
6323
    qim.getInstantiate()->addRewriter(d_i_cbqi->getInstRewriter());
71
  }
72
6414
  if (options::sygus())
73
  {
74
1529
    d_synth_e.reset(new SynthEngine(qs, qim, qr, tr));
75
1529
    modules.push_back(d_synth_e.get());
76
  }
77
  // finite model finding
78
6414
  if (options::fmfBound())
79
  {
80
1098
    d_bint.reset(new BoundedIntegers(qs, qim, qr, tr));
81
1098
    modules.push_back(d_bint.get());
82
  }
83
84
6414
  if (options::finiteModelFind() || options::fmfBound())
85
  {
86
1338
    d_model_engine.reset(new ModelEngine(qs, qim, qr, tr, builder));
87
1338
    modules.push_back(d_model_engine.get());
88
  }
89
6414
  if (options::quantDynamicSplit() != options::QuantDSplitMode::NONE)
90
  {
91
5167
    d_qsplit.reset(new QuantDSplit(qs, qim, qr, tr));
92
5167
    modules.push_back(d_qsplit.get());
93
  }
94
12828
  if (options::quantAlphaEquiv())
95
  {
96
6414
    d_alpha_equiv.reset(new AlphaEquivalence());
97
  }
98
  // full saturation : instantiate from relevant domain, then arbitrary terms
99
6414
  if (options::fullSaturateQuant() || options::fullSaturateInterleave())
100
  {
101
83
    d_rel_dom.reset(new RelevantDomain(qs, qr, tr));
102
83
    d_fs.reset(new InstStrategyEnum(qs, qim, qr, tr, d_rel_dom.get()));
103
83
    modules.push_back(d_fs.get());
104
  }
105
12831
  if (options::poolInst())
106
  {
107
6414
    d_ipool.reset(new InstStrategyPool(qs, qim, qr, tr));
108
6414
    modules.push_back(d_ipool.get());
109
  }
110
6414
  if (options::sygusInst())
111
  {
112
20
    d_sygus_inst.reset(new SygusInst(qs, qim, qr, tr));
113
20
    modules.push_back(d_sygus_inst.get());
114
  }
115
6414
}
116
117
}  // namespace quantifiers
118
}  // namespace theory
119
28194
}  // namespace cvc5