1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
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 |
|
* Utilities for management of equality engines. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "theory/ee_manager.h" |
17 |
|
|
18 |
|
#include "theory/theory_model.h" |
19 |
|
|
20 |
|
namespace cvc5 { |
21 |
|
namespace theory { |
22 |
|
|
23 |
9924 |
EqEngineManager::EqEngineManager(TheoryEngine& te, SharedSolver& shs) |
24 |
9924 |
: d_te(te), d_sharedSolver(shs) |
25 |
|
{ |
26 |
9924 |
} |
27 |
|
|
28 |
129012 |
const EeTheoryInfo* EqEngineManager::getEeTheoryInfo(TheoryId tid) const |
29 |
|
{ |
30 |
129012 |
std::map<TheoryId, EeTheoryInfo>::const_iterator it = d_einfo.find(tid); |
31 |
129012 |
if (it != d_einfo.end()) |
32 |
|
{ |
33 |
129012 |
return &it->second; |
34 |
|
} |
35 |
|
return nullptr; |
36 |
|
} |
37 |
|
|
38 |
118701 |
eq::EqualityEngine* EqEngineManager::allocateEqualityEngine(EeSetupInfo& esi, |
39 |
|
context::Context* c) |
40 |
|
{ |
41 |
118701 |
if (esi.d_notify != nullptr) |
42 |
|
{ |
43 |
|
return new eq::EqualityEngine( |
44 |
108777 |
*esi.d_notify, c, esi.d_name, esi.d_constantsAreTriggers); |
45 |
|
} |
46 |
|
// the theory doesn't care about explicit notifications |
47 |
9924 |
return new eq::EqualityEngine(c, esi.d_name, esi.d_constantsAreTriggers); |
48 |
|
} |
49 |
|
|
50 |
|
} // namespace theory |
51 |
29499 |
} // namespace cvc5 |