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-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 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/eager_proof_generator.h"
24 #include "theory/ee_manager.h"
25 #include "theory/model_manager.h"
26 #include "theory/shared_solver.h"
35 * Manager for doing theory combination. This class is responsible for:
36 * (1) Initializing the various components of theory combination (equality
37 * engine manager, model manager, shared solver) based on the equality engine
39 * (2) Implementing the main combination method (combineTheories).
41 class CombinationEngine
44 CombinationEngine(TheoryEngine
& te
,
45 const std::vector
<Theory
*>& paraTheories
,
46 ProofNodeManager
* pnm
);
47 virtual ~CombinationEngine();
49 /** Finish initialization */
52 //-------------------------- equality engine
53 /** Get equality engine theory information for theory with identifier tid. */
54 const EeTheoryInfo
* getEeTheoryInfo(TheoryId tid
) const;
56 * Get the "core" equality engine. This is the equality engine that
57 * quantifiers should use.
59 eq::EqualityEngine
* getCoreEqualityEngine();
60 //-------------------------- end equality engine
61 //-------------------------- model
63 * Reset the model maintained by this class. This resets all local information
64 * that is unique to each check.
68 * Build the model maintained by this class.
70 * @return true if model building was successful.
72 virtual bool buildModel() = 0;
74 * Post process the model maintained by this class. This is called after
75 * a successful call to buildModel. This does any theory-specific
76 * postprocessing of the model.
78 * @param incomplete Whether we are answering "unknown" instead of "sat".
80 void postProcessModel(bool incomplete
);
82 * Get the model object maintained by this class.
84 TheoryModel
* getModel();
85 //-------------------------- end model
87 * Get the shared solver, which is the active component of theory combination
88 * that TheoryEngine interacts with prior to calling combineTheories.
90 SharedSolver
* getSharedSolver();
92 * Called at the beginning of full effort
94 virtual void resetRound();
96 * Combine theories, called after FULL effort passes with no lemmas
97 * and before LAST_CALL effort is run. This adds necessary lemmas for
98 * theory combination (e.g. splitting lemmas) to the parent TheoryEngine.
100 virtual void combineTheories() = 0;
103 /** Is proof enabled? */
104 bool isProofEnabled() const;
106 * Get model equality engine notify. Return the notification object for
107 * who listens to the model's equality engine (if any).
109 virtual eq::EqualityEngineNotify
* getModelEqualityEngineNotify();
110 /** Send lemma to the theory engine, atomsTo is the theory to send atoms to */
111 void sendLemma(TrustNode trn
, TheoryId atomsTo
);
112 /** Reference to the theory engine */
114 /** The proof node manager */
115 ProofNodeManager
* d_pnm
;
116 /** Logic info of theory engine (cached) */
117 const LogicInfo
& d_logicInfo
;
118 /** List of parametric theories of theory engine */
119 const std::vector
<Theory
*> d_paraTheories
;
121 * The equality engine manager we are using. This class is responsible for
122 * configuring equality engines for each theory.
124 std::unique_ptr
<EqEngineManager
> d_eemanager
;
126 * The model manager we are using. This class is responsible for building the
129 std::unique_ptr
<ModelManager
> d_mmanager
;
131 * The shared solver. This class is responsible for performing combination
132 * tasks (e.g. preregistration) during solving.
134 std::unique_ptr
<SharedSolver
> d_sharedSolver
;
136 * An eager proof generator, if proofs are enabled. This proof generator is
137 * responsible for proofs of splitting lemmas generated in combineTheories.
139 std::unique_ptr
<EagerProofGenerator
> d_cmbsPg
;
142 } // namespace theory
145 #endif /* CVC4__THEORY__COMBINATION_DISTRIBUTED__H */