1 /********************* */
2 /*! \file combination_engine.h
4 ** Top contributors (to current version):
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 Abstract interface for theory combination.
15 #include "cvc4_private.h"
17 #ifndef CVC4__THEORY__COMBINATION_ENGINE__H
18 #define CVC4__THEORY__COMBINATION_ENGINE__H
23 #include "theory/ee_manager.h"
24 #include "theory/valuation.h"
32 class EagerProofGenerator
;
37 * Manager for doing theory combination. This class is responsible for:
38 * (1) Initializing the various components of theory combination (equality
39 * engine manager, model manager, shared solver) based on the equality engine
41 * (2) Implementing the main combination method (combineTheories).
43 class CombinationEngine
46 CombinationEngine(TheoryEngine
& te
,
47 const std::vector
<Theory
*>& paraTheories
,
48 ProofNodeManager
* pnm
);
49 virtual ~CombinationEngine();
51 /** Finish initialization */
54 /** Get equality engine theory information for theory with identifier tid. */
55 const EeTheoryInfo
* getEeTheoryInfo(TheoryId tid
) const;
56 //-------------------------- model
58 * Reset the model maintained by this class. This resets all local information
59 * that is unique to each check.
63 * Build the model maintained by this class.
65 * @return true if model building was successful.
67 virtual bool buildModel() = 0;
69 * Post process the model maintained by this class. This is called after
70 * a successful call to buildModel. This does any theory-specific
71 * postprocessing of the model.
73 * @param incomplete Whether we are answering "unknown" instead of "sat".
75 void postProcessModel(bool incomplete
);
77 * Get the model object maintained by this class.
79 TheoryModel
* getModel();
80 //-------------------------- end model
82 * Get the shared solver, which is the active component of theory combination
83 * that TheoryEngine interacts with prior to calling combineTheories.
85 SharedSolver
* getSharedSolver();
87 * Called at the beginning of full effort
89 virtual void resetRound();
91 * Combine theories, called after FULL effort passes with no lemmas
92 * and before LAST_CALL effort is run. This adds necessary lemmas for
93 * theory combination (e.g. splitting lemmas) to the parent TheoryEngine.
95 virtual void combineTheories() = 0;
98 /** Is proof enabled? */
99 bool isProofEnabled() const;
101 * Get model equality engine notify. Return the notification object for
102 * who listens to the model's equality engine (if any).
104 virtual eq::EqualityEngineNotify
* getModelEqualityEngineNotify();
105 /** Send lemma to the theory engine, atomsTo is the theory to send atoms to */
106 void sendLemma(TrustNode trn
, TheoryId atomsTo
);
107 /** Reference to the theory engine */
109 /** Valuation for the engine */
110 Valuation d_valuation
;
111 /** The proof node manager */
112 ProofNodeManager
* d_pnm
;
113 /** Logic info of theory engine (cached) */
114 const LogicInfo
& d_logicInfo
;
115 /** List of parametric theories of theory engine */
116 const std::vector
<Theory
*> d_paraTheories
;
118 * The equality engine manager we are using. This class is responsible for
119 * configuring equality engines for each theory.
121 std::unique_ptr
<EqEngineManager
> d_eemanager
;
123 * The model manager we are using. This class is responsible for building the
126 std::unique_ptr
<ModelManager
> d_mmanager
;
128 * The shared solver. This class is responsible for performing combination
129 * tasks (e.g. preregistration) during solving.
131 std::unique_ptr
<SharedSolver
> d_sharedSolver
;
133 * An eager proof generator, if proofs are enabled. This proof generator is
134 * responsible for proofs of splitting lemmas generated in combineTheories.
136 std::unique_ptr
<EagerProofGenerator
> d_cmbsPg
;
139 } // namespace theory
142 #endif /* CVC4__THEORY__COMBINATION_DISTRIBUTED__H */