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 |
6413 |
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 |
6413 |
d_sygus_inst(nullptr) |
40 |
|
{ |
41 |
6413 |
} |
42 |
6413 |
QuantifiersModules::~QuantifiersModules() {} |
43 |
6413 |
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 |
6413 |
if (options::quantConflictFind()) |
52 |
|
{ |
53 |
4619 |
d_qcf.reset(new QuantConflictFind(qs, qim, qr, tr)); |
54 |
4619 |
modules.push_back(d_qcf.get()); |
55 |
|
} |
56 |
6413 |
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 |
6413 |
if (!options::finiteModelFind() || options::fmfInstEngine()) |
62 |
|
{ |
63 |
6157 |
d_inst_engine.reset(new InstantiationEngine(qs, qim, qr, tr)); |
64 |
6157 |
modules.push_back(d_inst_engine.get()); |
65 |
|
} |
66 |
6413 |
if (options::cegqi()) |
67 |
|
{ |
68 |
6322 |
d_i_cbqi.reset(new InstStrategyCegqi(qs, qim, qr, tr)); |
69 |
6322 |
modules.push_back(d_i_cbqi.get()); |
70 |
6322 |
qim.getInstantiate()->addRewriter(d_i_cbqi->getInstRewriter()); |
71 |
|
} |
72 |
6413 |
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 |
6413 |
if (options::fmfBound()) |
79 |
|
{ |
80 |
1097 |
d_bint.reset(new BoundedIntegers(qs, qim, qr, tr)); |
81 |
1097 |
modules.push_back(d_bint.get()); |
82 |
|
} |
83 |
|
|
84 |
6413 |
if (options::finiteModelFind() || options::fmfBound()) |
85 |
|
{ |
86 |
1337 |
d_model_engine.reset(new ModelEngine(qs, qim, qr, tr, builder)); |
87 |
1337 |
modules.push_back(d_model_engine.get()); |
88 |
|
} |
89 |
6413 |
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 |
12826 |
if (options::quantAlphaEquiv()) |
95 |
|
{ |
96 |
6413 |
d_alpha_equiv.reset(new AlphaEquivalence()); |
97 |
|
} |
98 |
|
// full saturation : instantiate from relevant domain, then arbitrary terms |
99 |
6413 |
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 |
12829 |
if (options::poolInst()) |
106 |
|
{ |
107 |
6413 |
d_ipool.reset(new InstStrategyPool(qs, qim, qr, tr)); |
108 |
6413 |
modules.push_back(d_ipool.get()); |
109 |
|
} |
110 |
6413 |
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 |
6413 |
} |
116 |
|
|
117 |
|
} // namespace quantifiers |
118 |
|
} // namespace theory |
119 |
28191 |
} // namespace cvc5 |