1 /********************* */
2 /*! \file theory_engine.h
4 ** Top contributors (to current version):
5 ** Morgan Deters, Dejan Jovanovic, Andrew Reynolds
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2016 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 The theory engine
17 #include "cvc4_private.h"
19 #ifndef __CVC4__THEORY_ENGINE_H
20 #define __CVC4__THEORY_ENGINE_H
27 #include "base/cvc4_assert.h"
28 #include "context/cdhashset.h"
29 #include "expr/node.h"
30 #include "options/options.h"
31 #include "options/smt_options.h"
32 #include "prop/prop_engine.h"
33 #include "smt/command.h"
34 #include "smt_util/lemma_channels.h"
35 #include "theory/atom_requests.h"
36 #include "theory/bv/bv_to_bool.h"
37 #include "theory/interrupted.h"
38 #include "theory/quantifiers/quant_conflict_find.h"
39 #include "theory/rewriter.h"
40 #include "theory/shared_terms_database.h"
41 #include "theory/sort_inference.h"
42 #include "theory/substitutions.h"
43 #include "theory/term_registration_visitor.h"
44 #include "theory/theory.h"
45 #include "theory/uf/equality_engine.h"
46 #include "theory/valuation.h"
47 #include "util/statistics_registry.h"
48 #include "util/unsafe_interrupt_exception.h"
52 class ResourceManager
;
53 class LemmaProofRecipe
;
56 * A pair of a theory and a node. This is used to mark the flow of
57 * propagations between theories.
59 struct NodeTheoryPair
{
61 theory::TheoryId theory
;
63 NodeTheoryPair(TNode node
, theory::TheoryId theory
, size_t timestamp
= 0)
64 : node(node
), theory(theory
), timestamp(timestamp
) {}
66 : theory(theory::THEORY_LAST
) {}
67 // Comparison doesn't take into account the timestamp
68 bool operator == (const NodeTheoryPair
& pair
) const {
69 return node
== pair
.node
&& theory
== pair
.theory
;
71 };/* struct NodeTheoryPair */
73 struct NodeTheoryPairHashFunction
{
74 NodeHashFunction hashFunction
;
75 // Hash doesn't take into account the timestamp
76 size_t operator()(const NodeTheoryPair
& pair
) const {
77 return hashFunction(pair
.node
)*0x9e3779b9 + pair
.theory
;
79 };/* struct NodeTheoryPairHashFunction */
82 /* Forward declarations */
85 class TheoryEngineModelBuilder
;
90 }/* CVC4::theory::eq namespace */
92 namespace quantifiers
{
96 class EntailmentCheckParameters
;
97 class EntailmentCheckSideEffects
;
98 }/* CVC4::theory namespace */
100 class DecisionEngine
;
102 class UnconstrainedSimplifier
;
105 * This is essentially an abstraction for a collection of theories. A
106 * TheoryEngine provides services to a PropEngine, making various
107 * T-solvers look like a single unit to the propositional part of
112 /** Shared terms database can use the internals notify the theories */
113 friend class SharedTermsDatabase
;
114 friend class theory::quantifiers::TermDb
;
116 /** Associated PropEngine engine */
117 prop::PropEngine
* d_propEngine
;
119 /** Access to decision engine */
120 DecisionEngine
* d_decisionEngine
;
123 context::Context
* d_context
;
125 /** Our user context */
126 context::UserContext
* d_userContext
;
129 * A table of from theory IDs to theory pointers. Never use this table
130 * directly, use theoryOf() instead.
132 theory::Theory
* d_theoryTable
[theory::THEORY_LAST
];
135 * A collection of theories that are "active" for the current run.
136 * This set is provided by the user (as a logic string, say, in SMT-LIBv2
137 * format input), or else by default it's all-inclusive. This is important
138 * because we can optimize for single-theory runs (no sharing), can reduce
139 * the cost of walking the DAG on registration, etc.
141 const LogicInfo
& d_logicInfo
;
144 * The database of shared terms.
146 SharedTermsDatabase d_sharedTerms
;
149 * Master equality engine, to share with theories.
151 theory::eq::EqualityEngine
* d_masterEqualityEngine
;
153 /** notify class for master equality engine */
154 class NotifyClass
: public theory::eq::EqualityEngineNotify
{
157 NotifyClass(TheoryEngine
& te
): d_te(te
) {}
158 bool eqNotifyTriggerEquality(TNode equality
, bool value
) { return true; }
159 bool eqNotifyTriggerPredicate(TNode predicate
, bool value
) { return true; }
160 bool eqNotifyTriggerTermEquality(theory::TheoryId tag
, TNode t1
, TNode t2
, bool value
) { return true; }
161 void eqNotifyConstantTermMerge(TNode t1
, TNode t2
) {}
162 void eqNotifyNewClass(TNode t
) { d_te
.eqNotifyNewClass(t
); }
163 void eqNotifyPreMerge(TNode t1
, TNode t2
) { d_te
.eqNotifyPreMerge(t1
, t2
); }
164 void eqNotifyPostMerge(TNode t1
, TNode t2
) { d_te
.eqNotifyPostMerge(t1
, t2
); }
165 void eqNotifyDisequal(TNode t1
, TNode t2
, TNode reason
) { d_te
.eqNotifyDisequal(t1
, t2
, reason
); }
166 };/* class TheoryEngine::NotifyClass */
167 NotifyClass d_masterEENotify
;
170 * notification methods
172 void eqNotifyNewClass(TNode t
);
173 void eqNotifyPreMerge(TNode t1
, TNode t2
);
174 void eqNotifyPostMerge(TNode t1
, TNode t2
);
175 void eqNotifyDisequal(TNode t1
, TNode t2
, TNode reason
);
178 * The quantifiers engine
180 theory::QuantifiersEngine
* d_quantEngine
;
183 * Default model object
185 theory::TheoryModel
* d_curr_model
;
186 bool d_aloc_curr_model
;
188 * Model builder object
190 theory::TheoryEngineModelBuilder
* d_curr_model_builder
;
192 typedef std::hash_map
<Node
, Node
, NodeHashFunction
> NodeMap
;
193 typedef std::hash_map
<TNode
, Node
, TNodeHashFunction
> TNodeMap
;
196 * Cache for theory-preprocessing of assertions
201 * Used for "missed-t-propagations" dumping mode only. A set of all
202 * theory-propagable literals.
204 context::CDList
<TNode
> d_possiblePropagations
;
207 * Used for "missed-t-propagations" dumping mode only. A
208 * context-dependent set of those theory-propagable literals that
209 * have been propagated.
211 context::CDHashSet
<Node
, NodeHashFunction
> d_hasPropagated
;
215 * Statistics for a particular theory.
219 static std::string
mkName(std::string prefix
,
220 theory::TheoryId theory
,
221 std::string suffix
) {
222 std::stringstream ss
;
223 ss
<< prefix
<< theory
<< suffix
;
229 IntStat conflicts
, propagations
, lemmas
, requirePhase
, flipDecision
, restartDemands
;
231 Statistics(theory::TheoryId theory
);
233 };/* class TheoryEngine::Statistics */
237 * An output channel for Theory that passes messages
238 * back to a TheoryEngine.
240 class EngineOutputChannel
: public theory::OutputChannel
{
242 friend class TheoryEngine
;
245 * The theory engine we're communicating with.
247 TheoryEngine
* d_engine
;
250 * The statistics of the theory interractions.
252 Statistics d_statistics
;
255 * The theory owning this chanell.
257 theory::TheoryId d_theory
;
261 EngineOutputChannel(TheoryEngine
* engine
, theory::TheoryId theory
) :
263 d_statistics(theory
),
268 void safePoint(uint64_t ammount
) throw(theory::Interrupted
, UnsafeInterruptException
, AssertionException
) {
269 spendResource(ammount
);
270 if (d_engine
->d_interrupted
) {
271 throw theory::Interrupted();
275 void conflict(TNode conflictNode
, Proof
* pf
= NULL
) throw(AssertionException
, UnsafeInterruptException
);
277 bool propagate(TNode literal
) throw(AssertionException
, UnsafeInterruptException
);
279 theory::LemmaStatus
lemma(TNode lemma
,
281 bool removable
= false,
282 bool preprocess
= false,
283 bool sendAtoms
= false)
284 throw(TypeCheckingExceptionPrivate
, AssertionException
, UnsafeInterruptException
);
286 theory::LemmaStatus
splitLemma(TNode lemma
, bool removable
= false) throw(TypeCheckingExceptionPrivate
, AssertionException
, UnsafeInterruptException
);
288 void demandRestart() throw(TypeCheckingExceptionPrivate
, AssertionException
, UnsafeInterruptException
) {
289 NodeManager
* curr
= NodeManager::currentNM();
290 Node restartVar
= curr
->mkSkolem("restartVar",
292 "A boolean variable asserted to be true to force a restart");
293 Trace("theory::restart") << "EngineOutputChannel<" << d_theory
<< ">::restart(" << restartVar
<< ")" << std::endl
;
294 ++ d_statistics
.restartDemands
;
295 lemma(restartVar
, RULE_INVALID
, true);
298 void requirePhase(TNode n
, bool phase
)
299 throw(theory::Interrupted
, AssertionException
, UnsafeInterruptException
) {
300 Debug("theory") << "EngineOutputChannel::requirePhase("
301 << n
<< ", " << phase
<< ")" << std::endl
;
302 ++ d_statistics
.requirePhase
;
303 d_engine
->d_propEngine
->requirePhase(n
, phase
);
307 throw(theory::Interrupted
, AssertionException
, UnsafeInterruptException
) {
308 Debug("theory") << "EngineOutputChannel::flipDecision()" << std::endl
;
309 ++ d_statistics
.flipDecision
;
310 return d_engine
->d_propEngine
->flipDecision();
313 void setIncomplete() throw(AssertionException
, UnsafeInterruptException
) {
314 Trace("theory") << "TheoryEngine::setIncomplete()" << std::endl
;
315 d_engine
->setIncomplete(d_theory
);
318 void spendResource(unsigned ammount
) throw(UnsafeInterruptException
) {
319 d_engine
->spendResource(ammount
);
322 void handleUserAttribute( const char* attr
, theory::Theory
* t
){
323 d_engine
->handleUserAttribute( attr
, t
);
329 * A helper function for registering lemma recipes with the proof engine
331 void registerLemmaRecipe(Node lemma
, Node originalLemma
, bool preprocess
, theory::TheoryId theoryId
);
332 };/* class TheoryEngine::EngineOutputChannel */
335 * Output channels for individual theories.
337 EngineOutputChannel
* d_theoryOut
[theory::THEORY_LAST
];
340 * Are we in conflict.
342 context::CDO
<bool> d_inConflict
;
345 * Called by the theories to notify of a conflict.
347 void conflict(TNode conflict
, theory::TheoryId theoryId
);
350 * Debugging flag to ensure that shutdown() is called before the
356 * True if a theory has notified us of incompleteness (at this
357 * context level or below).
359 context::CDO
<bool> d_incomplete
;
362 * Called by the theories to notify that the current branch is incomplete.
364 void setIncomplete(theory::TheoryId theory
) {
370 * Mapping of propagations from recievers to senders.
372 typedef context::CDHashMap
<NodeTheoryPair
, NodeTheoryPair
, NodeTheoryPairHashFunction
> PropagationMap
;
373 PropagationMap d_propagationMap
;
376 * Timestamp of propagations
378 context::CDO
<size_t> d_propagationMapTimestamp
;
381 * Literals that are propagated by the theory. Note that these are TNodes.
382 * The theory can only propagate nodes that have an assigned literal in the
383 * SAT solver and are hence referenced in the SAT solver.
385 context::CDList
<TNode
> d_propagatedLiterals
;
388 * The index of the next literal to be propagated by a theory.
390 context::CDO
<unsigned> d_propagatedLiteralsIndex
;
393 * Called by the output channel to propagate literals and facts
394 * @return false if immediate conflict
396 bool propagate(TNode literal
, theory::TheoryId theory
);
399 * Internal method to call the propagation routines and collect the
400 * propagated literals.
402 void propagate(theory::Theory::Effort effort
);
405 * Called by the output channel to request decisions "as soon as
408 void propagateAsDecision(TNode literal
, theory::TheoryId theory
);
411 * A variable to mark if we added any lemmas.
416 * A variable to mark if the OutputChannel was "used" by any theory
417 * since the start of the last check. If it has been, we require
418 * a FULL_EFFORT check before exiting and reporting SAT.
420 * See the documentation for the needCheck() function, below.
422 bool d_outputChannelUsed
;
424 /** Atom requests from lemmas */
425 AtomRequests d_atomRequests
;
428 * Adds a new lemma, returning its status.
429 * @param node the lemma
430 * @param negated should the lemma be asserted negated
431 * @param removable can the lemma be remove (restrictions apply)
432 * @param needAtoms if not THEORY_LAST, then
434 theory::LemmaStatus
lemma(TNode node
,
439 theory::TheoryId atomsTo
);
441 /** Enusre that the given atoms are send to the given theory */
442 void ensureLemmaAtoms(const std::vector
<TNode
>& atoms
, theory::TheoryId theory
);
444 RemoveITE
& d_iteRemover
;
446 /** sort inference module */
447 SortInference d_sortInfer
;
449 /** Time spent in theory combination */
450 TimerStat d_combineTheoriesTime
;
455 /** Whether we were just interrupted (or not) */
457 ResourceManager
* d_resourceManager
;
459 /** Container for lemma input and output channels. */
460 LemmaChannels
* d_channels
;
464 /** Constructs a theory engine */
465 TheoryEngine(context::Context
* context
, context::UserContext
* userContext
,
466 RemoveITE
& iteRemover
, const LogicInfo
& logic
,
467 LemmaChannels
* channels
);
469 /** Destroys a theory engine */
472 void interrupt() throw(ModalException
);
474 * "Spend" a resource during a search or preprocessing.
476 void spendResource(unsigned ammount
);
479 * Adds a theory. Only one theory per TheoryId can be present, so if
480 * there is another theory it will be deleted.
482 template <class TheoryClass
>
483 inline void addTheory(theory::TheoryId theoryId
) {
484 Assert(d_theoryTable
[theoryId
] == NULL
&& d_theoryOut
[theoryId
] == NULL
);
485 d_theoryOut
[theoryId
] = new EngineOutputChannel(this, theoryId
);
486 d_theoryTable
[theoryId
] =
487 new TheoryClass(d_context
, d_userContext
, *d_theoryOut
[theoryId
],
488 theory::Valuation(this), d_logicInfo
);
491 inline void setPropEngine(prop::PropEngine
* propEngine
) {
492 Assert(d_propEngine
== NULL
);
493 d_propEngine
= propEngine
;
496 inline void setDecisionEngine(DecisionEngine
* decisionEngine
) {
497 Assert(d_decisionEngine
== NULL
);
498 d_decisionEngine
= decisionEngine
;
501 /** Called when all initialization of options/logic is done */
505 * Get a pointer to the underlying propositional engine.
507 inline prop::PropEngine
* getPropEngine() const {
512 * Get a pointer to the underlying sat context.
514 inline context::Context
* getSatContext() const {
519 * Get a pointer to the underlying user context.
521 inline context::Context
* getUserContext() const {
522 return d_userContext
;
526 * Get a pointer to the underlying quantifiers engine.
528 theory::QuantifiersEngine
* getQuantifiersEngine() const {
529 return d_quantEngine
;
535 * Helper for preprocess
537 Node
ppTheoryRewrite(TNode term
);
540 * Queue of nodes for pre-registration.
542 std::queue
<TNode
> d_preregisterQueue
;
545 * Boolean flag denoting we are in pre-registration.
547 bool d_inPreregister
;
550 * Did the theories get any new facts since the last time we called
553 context::CDO
<bool> d_factsAsserted
;
556 * Map from equality atoms to theories that would like to be notified about them.
561 * Assert the formula to the given theory.
562 * @param assertion the assertion to send (not necesserily normalized)
563 * @param original the assertion as it was sent in from the propagating theory
564 * @param toTheoryId the theory to assert to
565 * @param fromTheoryId the theory that sent it
567 void assertToTheory(TNode assertion
, TNode originalAssertion
, theory::TheoryId toTheoryId
, theory::TheoryId fromTheoryId
);
570 * Marks a theory propagation from a theory to a theory where a
571 * theory could be the THEORY_SAT_SOLVER for literals coming from
572 * or being propagated to the SAT solver. If the receiving theory
573 * already recieved the literal, the method returns false, otherwise
576 * @param assertion the normalized assertion being sent
577 * @param originalAssertion the actual assertion that was sent
578 * @param toTheoryId the theory that is on the receiving end
579 * @param fromTheoryId the theory that sent the assertino
580 * @return true if a new assertion, false if theory already got it
582 bool markPropagation(TNode assertion
, TNode originalAssertions
, theory::TheoryId toTheoryId
, theory::TheoryId fromTheoryId
);
585 * Computes the explanation by travarsing the propagation graph and
586 * asking relevant theories to explain the propagations. Initially
587 * the explanation vector should contain only the element (node, theory)
588 * where the node is the one to be explained, and the theory is the
589 * theory that sent the literal. The lemmaProofRecipe will contain a list
590 * of the explanation steps required to produce the original node.
592 void getExplanation(std::vector
<NodeTheoryPair
>& explanationVector
, LemmaProofRecipe
* lemmaProofRecipe
);
597 * Signal the start of a new round of assertion preprocessing
599 void preprocessStart();
602 * Runs theory specific preprocessing on the non-Boolean parts of
603 * the formula. This is only called on input assertions, after ITEs
606 Node
preprocess(TNode node
);
610 * Notify (preprocessed) assertions
612 void notifyPreprocessedAssertions( std::vector
< Node
>& assertions
);
615 * Return whether or not we are incomplete (in the current context).
617 inline bool isIncomplete() const {
622 * Returns true if we need another round of checking. If this
623 * returns true, check(FULL_EFFORT) _must_ be called by the
624 * propositional layer before reporting SAT.
626 * This is especially necessary for incomplete theories that lazily
627 * output some lemmas on FULL_EFFORT check (e.g. quantifier reasoning
628 * outputing quantifier instantiations). In such a case, a lemma can
629 * be asserted that is simplified away (perhaps it's already true).
630 * However, we must maintain the invariant that, if a theory uses the
631 * OutputChannel, it implicitly requests that another check(FULL_EFFORT)
632 * be performed before exit, even if no new facts are on its fact queue,
633 * as it might decide to further instantiate some lemmas, precluding
636 inline bool needCheck() const {
637 return d_outputChannelUsed
|| d_lemmasAdded
;
641 * This is called at shutdown time by the SmtEngine, just before
642 * destruction. It is important because there are destruction
643 * ordering issues between PropEngine and Theory.
648 * Solve the given literal with a theory that owns it.
650 theory::Theory::PPAssertStatus
solve(TNode literal
,
651 theory::SubstitutionMap
& substitutionOut
);
654 * Preregister a Theory atom with the responsible theory (or
657 void preRegister(TNode preprocessed
);
660 * Assert the formula to the appropriate theory.
661 * @param node the assertion
663 void assertFact(TNode node
);
666 * Check all (currently-active) theories for conflicts.
667 * @param effort the effort level to use
669 void check(theory::Theory::Effort effort
);
672 * Run the combination framework.
674 void combineTheories();
677 * Calls ppStaticLearn() on all theories, accumulating their
678 * combined contributions in the "learned" builder.
680 void ppStaticLearn(TNode in
, NodeBuilder
<>& learned
);
683 * Calls presolve() on all theories and returns true
684 * if one of the theories discovers a conflict.
689 * Calls postsolve() on all theories.
694 * Calls notifyRestart() on all active theories.
696 void notifyRestart();
698 void getPropagatedLiterals(std::vector
<TNode
>& literals
) {
699 for (; d_propagatedLiteralsIndex
< d_propagatedLiterals
.size(); d_propagatedLiteralsIndex
= d_propagatedLiteralsIndex
+ 1) {
700 Debug("getPropagatedLiterals") << "TheoryEngine::getPropagatedLiterals: propagating: " << d_propagatedLiterals
[d_propagatedLiteralsIndex
] << std::endl
;
701 literals
.push_back(d_propagatedLiterals
[d_propagatedLiteralsIndex
]);
705 Node
getNextDecisionRequest();
707 bool properConflict(TNode conflict
) const;
708 bool properPropagation(TNode lit
) const;
709 bool properExplanation(TNode node
, TNode expl
) const;
712 * Returns an explanation of the node propagated to the SAT solver.
714 Node
getExplanation(TNode node
);
717 * Returns an explanation of the node propagated to the SAT solver and the theory
718 * that propagated it.
720 Node
getExplanationAndRecipe(TNode node
, LemmaProofRecipe
* proofRecipe
);
725 void collectModelInfo( theory::TheoryModel
* m
, bool fullModel
);
726 /** post process model */
727 void postProcessModel( theory::TheoryModel
* m
);
730 * Get the current model
732 theory::TheoryModel
* getModel();
735 * Get the model builder
737 theory::TheoryEngineModelBuilder
* getModelBuilder() { return d_curr_model_builder
; }
740 * Get the theory associated to a given Node.
742 * @returns the theory, or NULL if the TNode is
745 inline theory::Theory
* theoryOf(TNode node
) const {
746 return d_theoryTable
[theory::Theory::theoryOf(node
)];
750 * Get the theory associated to a the given theory id.
752 * @returns the theory
754 inline theory::Theory
* theoryOf(theory::TheoryId theoryId
) const {
755 return d_theoryTable
[theoryId
];
758 inline bool isTheoryEnabled(theory::TheoryId theoryId
) const {
759 return d_logicInfo
.isTheoryEnabled(theoryId
);
763 * Returns the equality status of the two terms, from the theory
764 * that owns the domain type. The types of a and b must be the same.
766 theory::EqualityStatus
getEqualityStatus(TNode a
, TNode b
);
769 * Returns the value that a theory that owns the type of var currently
770 * has (or null if none);
772 Node
getModelValue(TNode var
);
775 * Takes a literal and returns an equivalent literal that is guaranteed to be a SAT literal
777 Node
ensureLiteral(TNode n
);
780 * Print all instantiations made by the quantifiers module.
782 void printInstantiations( std::ostream
& out
);
785 * Print solution for synthesis conjectures found by ce_guided_instantiation module
787 void printSynthSolution( std::ostream
& out
);
792 void getInstantiations( std::map
< Node
, std::vector
< Node
> >& insts
);
795 * Forwards an entailment check according to the given theoryOfMode.
796 * See theory.h for documentation on entailmentCheck().
798 std::pair
<bool, Node
> entailmentCheck(theory::TheoryOfMode mode
, TNode lit
, const theory::EntailmentCheckParameters
* params
= NULL
, theory::EntailmentCheckSideEffects
* out
= NULL
);
802 /** Default visitor for pre-registration */
803 PreRegisterVisitor d_preRegistrationVisitor
;
805 /** Visitor for collecting shared terms */
806 SharedTermsVisitor d_sharedTermsVisitor
;
808 /** Dump the assertions to the dump */
809 void dumpAssertions(const char* tag
);
812 * A collection of ite preprocessing passes.
814 theory::ITEUtilities
* d_iteUtilities
;
817 /** For preprocessing pass simplifying unconstrained expressions */
818 UnconstrainedSimplifier
* d_unconstrainedSimp
;
820 /** For preprocessing pass lifting bit-vectors of size 1 to booleans */
821 theory::bv::BvToBoolPreprocessor d_bvToBoolPreprocessor
;
823 void staticInitializeBVOptions(const std::vector
<Node
>& assertions
);
824 void ppBvToBool(const std::vector
<Node
>& assertions
, std::vector
<Node
>& new_assertions
);
825 bool ppBvAbstraction(const std::vector
<Node
>& assertions
, std::vector
<Node
>& new_assertions
);
826 void mkAckermanizationAsssertions(std::vector
<Node
>& assertions
);
828 Node
ppSimpITE(TNode assertion
);
829 /** Returns false if an assertion simplified to false. */
830 bool donePPSimpITE(std::vector
<Node
>& assertions
);
832 void ppUnconstrainedSimp(std::vector
<Node
>& assertions
);
834 SharedTermsDatabase
* getSharedTermsDatabase() { return &d_sharedTerms
; }
836 theory::eq::EqualityEngine
* getMasterEqualityEngine() { return d_masterEqualityEngine
; }
838 RemoveITE
* getIteRemover() { return &d_iteRemover
; }
840 SortInference
* getSortInference() { return &d_sortInfer
; }
842 /** Prints the assertions to the debug stream */
843 void printAssertions(const char* tag
);
845 /** Theory alternative is in use. */
846 bool useTheoryAlternative(const std::string
& name
);
848 /** Enables using a theory alternative by name. */
849 void enableTheoryAlternative(const std::string
& name
);
852 std::set
< std::string
> d_theoryAlternatives
;
854 std::map
< std::string
, std::vector
< theory::Theory
* > > d_attr_handle
;
858 * Set user attribute.
859 * This function is called when an attribute is set by a user. In SMT-LIBv2 this is done
860 * via the syntax (! n :attr)
862 void setUserAttribute(const std::string
& attr
, Node n
, std::vector
<Node
>& node_values
, std::string str_value
);
865 * Handle user attribute.
866 * Associates theory t with the attribute attr. Theory t will be
867 * notified whenever an attribute of name attr is set.
869 void handleUserAttribute(const char* attr
, theory::Theory
* t
);
872 * Check that the theory assertions are satisfied in the model.
873 * This function is called from the smt engine's checkModel routine.
875 void checkTheoryAssertionsWithModel();
878 IntStat d_arithSubstitutionsAdded
;
880 };/* class TheoryEngine */
882 }/* CVC4 namespace */
884 #endif /* __CVC4__THEORY_ENGINE_H */