1 /********************* */
2 /*! \file quantifiers_modules.cpp
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Mathias Preiner
6 ** This file is part of the CVC4 project.
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.\endverbatim
12 ** \brief Class for initializing the modules of quantifiers engine
15 #include "theory/quantifiers/quantifiers_modules.h"
17 #include "options/quantifiers_options.h"
18 #include "theory/quantifiers/relevant_domain.h"
19 #include "theory/quantifiers/term_registry.h"
20 #include "theory/quantifiers_engine.h"
24 namespace quantifiers
{
26 QuantifiersModules::QuantifiersModules()
28 d_alpha_equiv(nullptr),
29 d_inst_engine(nullptr),
30 d_model_engine(nullptr),
42 QuantifiersModules::~QuantifiersModules() {}
43 void QuantifiersModules::initialize(QuantifiersEngine
* qe
,
45 QuantifiersInferenceManager
& qim
,
46 QuantifiersRegistry
& qr
,
49 std::vector
<QuantifiersModule
*>& modules
)
51 // add quantifiers modules
52 if (options::quantConflictFind())
54 d_qcf
.reset(new QuantConflictFind(qe
, qs
, qim
, qr
));
55 modules
.push_back(d_qcf
.get());
57 if (options::conjectureGen())
59 d_sg_gen
.reset(new ConjectureGenerator(qe
, qs
, qim
, qr
));
60 modules
.push_back(d_sg_gen
.get());
62 if (!options::finiteModelFind() || options::fmfInstEngine())
64 d_inst_engine
.reset(new InstantiationEngine(qe
, qs
, qim
, qr
, tr
));
65 modules
.push_back(d_inst_engine
.get());
69 d_i_cbqi
.reset(new InstStrategyCegqi(qe
, qs
, qim
, qr
));
70 modules
.push_back(d_i_cbqi
.get());
71 qim
.getInstantiate()->addRewriter(d_i_cbqi
->getInstRewriter());
75 d_synth_e
.reset(new SynthEngine(qe
, qs
, qim
, qr
));
76 modules
.push_back(d_synth_e
.get());
78 // finite model finding
79 if (options::fmfBound())
81 d_bint
.reset(new BoundedIntegers(qe
, qs
, qim
, qr
, dm
));
82 modules
.push_back(d_bint
.get());
84 if (options::finiteModelFind() || options::fmfBound())
86 d_model_engine
.reset(new ModelEngine(qe
, qs
, qim
, qr
));
87 modules
.push_back(d_model_engine
.get());
88 Trace("quant-init-debug")
89 << "Initialize model engine, mbqi : " << options::mbqiMode() << " "
90 << options::fmfBound() << std::endl
;
93 Trace("quant-init-debug") << "...make fmc builder." << std::endl
;
94 d_builder
.reset(new fmcheck::FullModelChecker(qs
, qr
, qim
));
98 Trace("quant-init-debug")
99 << "...make default model builder." << std::endl
;
100 d_builder
.reset(new QModelBuilder(qs
, qr
, qim
));
103 if (options::quantDynamicSplit() != options::QuantDSplitMode::NONE
)
105 d_qsplit
.reset(new QuantDSplit(qe
, qs
, qim
, qr
));
106 modules
.push_back(d_qsplit
.get());
108 if (options::quantAlphaEquiv())
110 d_alpha_equiv
.reset(new AlphaEquivalence(qe
));
112 // full saturation : instantiate from relevant domain, then arbitrary terms
113 if (options::fullSaturateQuant() || options::fullSaturateInterleave())
115 d_rel_dom
.reset(new RelevantDomain(qe
, qr
));
116 d_fs
.reset(new InstStrategyEnum(qe
, qs
, qim
, qr
, d_rel_dom
.get()));
117 modules
.push_back(d_fs
.get());
119 if (options::sygusInst())
121 d_sygus_inst
.reset(new SygusInst(qe
, qs
, qim
, qr
));
122 modules
.push_back(d_sygus_inst
.get());
126 } // namespace quantifiers
127 } // namespace theory