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