GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/quantifiers_modules.cpp Lines: 44 44 100.0 %
Date: 2021-08-16 Branches: 65 94 69.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 "options/strings_options.h"
20
#include "theory/quantifiers/relevant_domain.h"
21
#include "theory/quantifiers/term_registry.h"
22
23
namespace cvc5 {
24
namespace theory {
25
namespace quantifiers {
26
27
6763
QuantifiersModules::QuantifiersModules()
28
    : d_rel_dom(nullptr),
29
      d_alpha_equiv(nullptr),
30
      d_inst_engine(nullptr),
31
      d_model_engine(nullptr),
32
      d_bint(nullptr),
33
      d_qcf(nullptr),
34
      d_sg_gen(nullptr),
35
      d_synth_e(nullptr),
36
      d_fs(nullptr),
37
      d_ipool(nullptr),
38
      d_i_cbqi(nullptr),
39
      d_qsplit(nullptr),
40
6763
      d_sygus_inst(nullptr)
41
{
42
6763
}
43
6763
QuantifiersModules::~QuantifiersModules() {}
44
6763
void QuantifiersModules::initialize(QuantifiersState& qs,
45
                                    QuantifiersInferenceManager& qim,
46
                                    QuantifiersRegistry& qr,
47
                                    TermRegistry& tr,
48
                                    QModelBuilder* builder,
49
                                    std::vector<QuantifiersModule*>& modules)
50
{
51
  // add quantifiers modules
52
6763
  if (options::quantConflictFind())
53
  {
54
4928
    d_qcf.reset(new QuantConflictFind(qs, qim, qr, tr));
55
4928
    modules.push_back(d_qcf.get());
56
  }
57
6763
  if (options::conjectureGen())
58
  {
59
10
    d_sg_gen.reset(new ConjectureGenerator(qs, qim, qr, tr));
60
10
    modules.push_back(d_sg_gen.get());
61
  }
62
6763
  if (!options::finiteModelFind() || options::fmfInstEngine())
63
  {
64
6503
    d_inst_engine.reset(new InstantiationEngine(qs, qim, qr, tr));
65
6503
    modules.push_back(d_inst_engine.get());
66
  }
67
6763
  if (options::cegqi())
68
  {
69
6647
    d_i_cbqi.reset(new InstStrategyCegqi(qs, qim, qr, tr));
70
6647
    modules.push_back(d_i_cbqi.get());
71
6647
    qim.getInstantiate()->addRewriter(d_i_cbqi->getInstRewriter());
72
  }
73
6763
  if (options::sygus())
74
  {
75
1151
    d_synth_e.reset(new SynthEngine(qs, qim, qr, tr));
76
1151
    modules.push_back(d_synth_e.get());
77
  }
78
  // bounded integer instantiation is used when the user requests it via
79
  // fmfBound, or if strings are enabled.
80
6763
  if (options::fmfBound() || options::stringExp())
81
  {
82
1195
    d_bint.reset(new BoundedIntegers(qs, qim, qr, tr));
83
1195
    modules.push_back(d_bint.get());
84
  }
85
86
6763
  if (options::finiteModelFind() || options::fmfBound() || options::stringExp())
87
  {
88
1439
    d_model_engine.reset(new ModelEngine(qs, qim, qr, tr, builder));
89
1439
    modules.push_back(d_model_engine.get());
90
  }
91
6763
  if (options::quantDynamicSplit() != options::QuantDSplitMode::NONE)
92
  {
93
5415
    d_qsplit.reset(new QuantDSplit(qs, qim, qr, tr));
94
5415
    modules.push_back(d_qsplit.get());
95
  }
96
6763
  if (options::quantAlphaEquiv())
97
  {
98
6763
    d_alpha_equiv.reset(new AlphaEquivalence());
99
  }
100
  // full saturation : instantiate from relevant domain, then arbitrary terms
101
6763
  if (options::fullSaturateQuant() || options::fullSaturateInterleave())
102
  {
103
98
    d_rel_dom.reset(new RelevantDomain(qs, qr, tr));
104
98
    d_fs.reset(new InstStrategyEnum(qs, qim, qr, tr, d_rel_dom.get()));
105
98
    modules.push_back(d_fs.get());
106
  }
107
6763
  if (options::poolInst())
108
  {
109
6763
    d_ipool.reset(new InstStrategyPool(qs, qim, qr, tr));
110
6763
    modules.push_back(d_ipool.get());
111
  }
112
6763
  if (options::sygusInst())
113
  {
114
20
    d_sygus_inst.reset(new SygusInst(qs, qim, qr, tr));
115
20
    modules.push_back(d_sygus_inst.get());
116
  }
117
6763
}
118
119
}  // namespace quantifiers
120
}  // namespace theory
121
29340
}  // namespace cvc5