1 /********************* */
2 /*! \file ee_manager_distributed.h
4 ** Top contributors (to current version):
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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 Management of a distributed approach for equality engines over
16 #include "cvc4_private.h"
18 #ifndef CVC4__THEORY__EE_MANAGER_DISTRIBUTED__H
19 #define CVC4__THEORY__EE_MANAGER_DISTRIBUTED__H
24 #include "theory/ee_manager.h"
25 #include "theory/uf/equality_engine.h"
31 * The (distributed) equality engine manager. This encapsulates an architecture
32 * in which all theories maintain their own copy of an equality engine.
34 * This class is not responsible for actually initializing equality engines in
35 * theories (since this class does not have access to the internals of Theory).
36 * Instead, it is only responsible for the construction of the equality
37 * engine objects themselves. TheoryEngine is responsible for querying this
38 * class during finishInit() to determine the equality engines to pass to each
39 * theories based on getEeTheoryInfo.
41 * This class is also responsible for setting up the master equality engine,
42 * which is used as a special communication channel to quantifiers engine (e.g.
43 * for ensuring quantifiers E-matching is aware of terms from all theories).
45 class EqEngineManagerDistributed
: public EqEngineManager
48 EqEngineManagerDistributed(TheoryEngine
& te
, SharedSolver
& shs
);
49 ~EqEngineManagerDistributed();
51 * Initialize theories. This method allocates unique equality engines
52 * per theories and connects them to a master equality engine.
54 void initializeTheories() override
;
56 void notifyModel(bool incomplete
) override
;
59 /** notify class for master equality engine */
60 class MasterNotifyClass
: public theory::eq::EqualityEngineNotify
63 MasterNotifyClass(QuantifiersEngine
* qe
) : d_quantEngine(qe
) {}
65 * Called when a new equivalence class is created in the master equality
68 void eqNotifyNewClass(TNode t
) override
;
70 bool eqNotifyTriggerPredicate(TNode predicate
, bool value
) override
74 bool eqNotifyTriggerTermEquality(TheoryId tag
,
81 void eqNotifyConstantTermMerge(TNode t1
, TNode t2
) override
{}
82 void eqNotifyMerge(TNode t1
, TNode t2
) override
{}
83 void eqNotifyDisequal(TNode t1
, TNode t2
, TNode reason
) override
{}
86 /** Pointer to quantifiers engine */
87 QuantifiersEngine
* d_quantEngine
;
89 /** The master equality engine notify class */
90 std::unique_ptr
<MasterNotifyClass
> d_masterEENotify
;
91 /** The master equality engine. */
92 std::unique_ptr
<eq::EqualityEngine
> d_masterEqualityEngine
;
93 /** The equality engine of the shared solver / shared terms database. */
94 std::unique_ptr
<eq::EqualityEngine
> d_stbEqualityEngine
;
100 #endif /* CVC4__THEORY__EE_MANAGER_DISTRIBUTED__H */