(proof-new) Update TheoryEngine lemma and conflict to TrustNode (#5056)
[cvc5.git] / src / theory / theory_engine.h
1 /********************* */
2 /*! \file theory_engine.h
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Dejan Jovanovic, Andrew Reynolds, Morgan Deters
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
11 **
12 ** \brief The theory engine
13 **
14 ** The theory engine.
15 **/
16
17 #include "cvc4_private.h"
18
19 #ifndef CVC4__THEORY_ENGINE_H
20 #define CVC4__THEORY_ENGINE_H
21
22 #include <deque>
23 #include <memory>
24 #include <set>
25 #include <unordered_map>
26 #include <utility>
27 #include <vector>
28
29 #include "base/check.h"
30 #include "context/cdhashset.h"
31 #include "expr/node.h"
32 #include "options/options.h"
33 #include "options/smt_options.h"
34 #include "options/theory_options.h"
35 #include "prop/prop_engine.h"
36 #include "smt/command.h"
37 #include "theory/atom_requests.h"
38 #include "theory/engine_output_channel.h"
39 #include "theory/interrupted.h"
40 #include "theory/rewriter.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/theory_preprocessor.h"
46 #include "theory/uf/equality_engine.h"
47 #include "theory/valuation.h"
48 #include "util/hash.h"
49 #include "util/resource_manager.h"
50 #include "util/statistics_registry.h"
51 #include "util/unsafe_interrupt_exception.h"
52
53 namespace CVC4 {
54
55 class ResourceManager;
56 class TheoryEngineProofGenerator;
57
58 /**
59 * A pair of a theory and a node. This is used to mark the flow of
60 * propagations between theories.
61 */
62 struct NodeTheoryPair {
63 Node d_node;
64 theory::TheoryId d_theory;
65 size_t d_timestamp;
66 NodeTheoryPair(TNode n, theory::TheoryId t, size_t ts = 0)
67 : d_node(n), d_theory(t), d_timestamp(ts)
68 {
69 }
70 NodeTheoryPair() : d_theory(theory::THEORY_LAST), d_timestamp() {}
71 // Comparison doesn't take into account the timestamp
72 bool operator == (const NodeTheoryPair& pair) const {
73 return d_node == pair.d_node && d_theory == pair.d_theory;
74 }
75 };/* struct NodeTheoryPair */
76
77 struct NodeTheoryPairHashFunction {
78 NodeHashFunction hashFunction;
79 // Hash doesn't take into account the timestamp
80 size_t operator()(const NodeTheoryPair& pair) const {
81 uint64_t hash = fnv1a::fnv1a_64(NodeHashFunction()(pair.d_node));
82 return static_cast<size_t>(fnv1a::fnv1a_64(pair.d_theory, hash));
83 }
84 };/* struct NodeTheoryPairHashFunction */
85
86
87 /* Forward declarations */
88 namespace theory {
89 class TheoryModel;
90 class CombinationEngine;
91 class DecisionManager;
92 class RelevanceManager;
93
94 namespace eq {
95 class EqualityEngine;
96 } // namespace eq
97
98 class EntailmentCheckParameters;
99 class EntailmentCheckSideEffects;
100 }/* CVC4::theory namespace */
101
102 class RemoveTermFormulas;
103
104 /**
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
108 * CVC4.
109 */
110 class TheoryEngine {
111
112 /** Shared terms database can use the internals notify the theories */
113 friend class SharedTermsDatabase;
114 friend class theory::CombinationEngine;
115 friend class theory::EngineOutputChannel;
116 friend class theory::CombinationEngine;
117
118 /** Associated PropEngine engine */
119 prop::PropEngine* d_propEngine;
120
121 /** Our context */
122 context::Context* d_context;
123
124 /** Our user context */
125 context::UserContext* d_userContext;
126
127 /**
128 * A table of from theory IDs to theory pointers. Never use this table
129 * directly, use theoryOf() instead.
130 */
131 theory::Theory* d_theoryTable[theory::THEORY_LAST];
132
133 /**
134 * A collection of theories that are "active" for the current run.
135 * This set is provided by the user (as a logic string, say, in SMT-LIBv2
136 * format input), or else by default it's all-inclusive. This is important
137 * because we can optimize for single-theory runs (no sharing), can reduce
138 * the cost of walking the DAG on registration, etc.
139 */
140 const LogicInfo& d_logicInfo;
141
142 //--------------------------------- new proofs
143 /** Proof node manager used by this theory engine, if proofs are enabled */
144 ProofNodeManager* d_pnm;
145 /** The lazy proof object
146 *
147 * This stores instructions for how to construct proofs for all theory lemmas.
148 */
149 std::shared_ptr<LazyCDProof> d_lazyProof;
150 /** The proof generator */
151 std::shared_ptr<TheoryEngineProofGenerator> d_tepg;
152 //--------------------------------- end new proofs
153
154 /**
155 * The database of shared terms.
156 */
157 SharedTermsDatabase d_sharedTerms;
158
159 /** The combination manager we are using */
160 std::unique_ptr<theory::CombinationEngine> d_tc;
161 /**
162 * The quantifiers engine
163 */
164 theory::QuantifiersEngine* d_quantEngine;
165 /**
166 * The decision manager
167 */
168 std::unique_ptr<theory::DecisionManager> d_decManager;
169 /** The relevance manager */
170 std::unique_ptr<theory::RelevanceManager> d_relManager;
171
172 /** Default visitor for pre-registration */
173 PreRegisterVisitor d_preRegistrationVisitor;
174
175 /** Visitor for collecting shared terms */
176 SharedTermsVisitor d_sharedTermsVisitor;
177
178 /** are we in eager model building mode? (see setEagerModelBuilding). */
179 bool d_eager_model_building;
180
181 typedef std::unordered_map<Node, Node, NodeHashFunction> NodeMap;
182 typedef std::unordered_map<TNode, Node, TNodeHashFunction> TNodeMap;
183
184 /**
185 * Used for "missed-t-propagations" dumping mode only. A set of all
186 * theory-propagable literals.
187 */
188 context::CDList<TNode> d_possiblePropagations;
189
190 /**
191 * Used for "missed-t-propagations" dumping mode only. A
192 * context-dependent set of those theory-propagable literals that
193 * have been propagated.
194 */
195 context::CDHashSet<Node, NodeHashFunction> d_hasPropagated;
196
197 /**
198 * Output channels for individual theories.
199 */
200 theory::EngineOutputChannel* d_theoryOut[theory::THEORY_LAST];
201
202 /**
203 * Are we in conflict.
204 */
205 context::CDO<bool> d_inConflict;
206
207 /**
208 * Are we in "SAT mode"? In this state, the user can query for the model.
209 * This corresponds to the state in Figure 4.1, page 52 of the SMT-LIB
210 * standard, version 2.6.
211 */
212 bool d_inSatMode;
213
214 /**
215 * Called by the theories to notify of a conflict.
216 *
217 * @param conflict The trust node containing the conflict and its proof
218 * generator (if it exists),
219 * @param theoryId The theory that sent the conflict
220 */
221 void conflict(theory::TrustNode conflict, theory::TheoryId theoryId);
222
223 /**
224 * Debugging flag to ensure that shutdown() is called before the
225 * destructor.
226 */
227 bool d_hasShutDown;
228
229 /**
230 * True if a theory has notified us of incompleteness (at this
231 * context level or below).
232 */
233 context::CDO<bool> d_incomplete;
234
235 /**
236 * Called by the theories to notify that the current branch is incomplete.
237 */
238 void setIncomplete(theory::TheoryId theory) {
239 d_incomplete = true;
240 }
241
242 /**
243 * Mapping of propagations from recievers to senders.
244 */
245 typedef context::CDHashMap<NodeTheoryPair, NodeTheoryPair, NodeTheoryPairHashFunction> PropagationMap;
246 PropagationMap d_propagationMap;
247
248 /**
249 * Timestamp of propagations
250 */
251 context::CDO<size_t> d_propagationMapTimestamp;
252
253 /**
254 * Literals that are propagated by the theory. Note that these are TNodes.
255 * The theory can only propagate nodes that have an assigned literal in the
256 * SAT solver and are hence referenced in the SAT solver.
257 */
258 context::CDList<TNode> d_propagatedLiterals;
259
260 /**
261 * The index of the next literal to be propagated by a theory.
262 */
263 context::CDO<unsigned> d_propagatedLiteralsIndex;
264
265 /**
266 * Called by the output channel to propagate literals and facts
267 * @return false if immediate conflict
268 */
269 bool propagate(TNode literal, theory::TheoryId theory);
270
271 /**
272 * Internal method to call the propagation routines and collect the
273 * propagated literals.
274 */
275 void propagate(theory::Theory::Effort effort);
276
277 /**
278 * A variable to mark if we added any lemmas.
279 */
280 bool d_lemmasAdded;
281
282 /**
283 * A variable to mark if the OutputChannel was "used" by any theory
284 * since the start of the last check. If it has been, we require
285 * a FULL_EFFORT check before exiting and reporting SAT.
286 *
287 * See the documentation for the needCheck() function, below.
288 */
289 bool d_outputChannelUsed;
290
291 /** Atom requests from lemmas */
292 AtomRequests d_atomRequests;
293
294 /**
295 * Adds a new lemma, returning its status.
296 * @param node the lemma
297 * @param p the properties of the lemma.
298 * @param atomsTo the theory that atoms of the lemma should be sent to
299 * @param from the theory that sent the lemma
300 * @return a lemma status, containing the lemma and context information
301 * about when it was sent.
302 */
303 theory::LemmaStatus lemma(theory::TrustNode node,
304 theory::LemmaProperty p,
305 theory::TheoryId atomsTo = theory::THEORY_LAST,
306 theory::TheoryId from = theory::THEORY_LAST);
307
308 /** Enusre that the given atoms are send to the given theory */
309 void ensureLemmaAtoms(const std::vector<TNode>& atoms, theory::TheoryId theory);
310
311 /** sort inference module */
312 SortInference d_sortInfer;
313
314 /** The theory preprocessor */
315 theory::TheoryPreprocessor d_tpp;
316
317 /** Time spent in theory combination */
318 TimerStat d_combineTheoriesTime;
319
320 Node d_true;
321 Node d_false;
322
323 /** Whether we were just interrupted (or not) */
324 bool d_interrupted;
325 ResourceManager* d_resourceManager;
326
327 public:
328 /** Constructs a theory engine */
329 TheoryEngine(context::Context* context,
330 context::UserContext* userContext,
331 ResourceManager* rm,
332 RemoveTermFormulas& iteRemover,
333 const LogicInfo& logic);
334
335 /** Destroys a theory engine */
336 ~TheoryEngine();
337
338 void interrupt();
339
340 /** "Spend" a resource during a search or preprocessing.*/
341 void spendResource(ResourceManager::Resource r);
342
343 /**
344 * Adds a theory. Only one theory per TheoryId can be present, so if
345 * there is another theory it will be deleted.
346 */
347 template <class TheoryClass>
348 inline void addTheory(theory::TheoryId theoryId)
349 {
350 Assert(d_theoryTable[theoryId] == NULL && d_theoryOut[theoryId] == NULL);
351 d_theoryOut[theoryId] = new theory::EngineOutputChannel(this, theoryId);
352 d_theoryTable[theoryId] = new TheoryClass(d_context,
353 d_userContext,
354 *d_theoryOut[theoryId],
355 theory::Valuation(this),
356 d_logicInfo,
357 nullptr);
358 theory::Rewriter::registerTheoryRewriter(
359 theoryId, d_theoryTable[theoryId]->getTheoryRewriter());
360 }
361
362 void setPropEngine(prop::PropEngine* propEngine)
363 {
364 d_propEngine = propEngine;
365 }
366
367 /**
368 * Called when all initialization of options/logic is done, after theory
369 * objects have been created.
370 *
371 * This initializes the quantifiers engine, the "official" equality engines
372 * of each theory as required, and the model and model builder utilities.
373 */
374 void finishInit();
375
376 /**
377 * Get a pointer to the underlying propositional engine.
378 */
379 inline prop::PropEngine* getPropEngine() const {
380 return d_propEngine;
381 }
382
383 /**
384 * Get a pointer to the underlying sat context.
385 */
386 context::Context* getSatContext() const { return d_context; }
387
388 /**
389 * Get a pointer to the underlying user context.
390 */
391 context::UserContext* getUserContext() const { return d_userContext; }
392
393 /**
394 * Get a pointer to the underlying quantifiers engine.
395 */
396 theory::QuantifiersEngine* getQuantifiersEngine() const {
397 return d_quantEngine;
398 }
399 /**
400 * Get a pointer to the underlying decision manager.
401 */
402 theory::DecisionManager* getDecisionManager() const
403 {
404 return d_decManager.get();
405 }
406
407 private:
408 /**
409 * Queue of nodes for pre-registration.
410 */
411 std::queue<TNode> d_preregisterQueue;
412
413 /**
414 * Boolean flag denoting we are in pre-registration.
415 */
416 bool d_inPreregister;
417
418 /**
419 * Did the theories get any new facts since the last time we called
420 * check()
421 */
422 context::CDO<bool> d_factsAsserted;
423
424 /**
425 * Assert the formula to the given theory.
426 * @param assertion the assertion to send (not necesserily normalized)
427 * @param original the assertion as it was sent in from the propagating theory
428 * @param toTheoryId the theory to assert to
429 * @param fromTheoryId the theory that sent it
430 */
431 void assertToTheory(TNode assertion, TNode originalAssertion, theory::TheoryId toTheoryId, theory::TheoryId fromTheoryId);
432
433 /**
434 * Marks a theory propagation from a theory to a theory where a
435 * theory could be the THEORY_SAT_SOLVER for literals coming from
436 * or being propagated to the SAT solver. If the receiving theory
437 * already recieved the literal, the method returns false, otherwise
438 * it returns true.
439 *
440 * @param assertion the normalized assertion being sent
441 * @param originalAssertion the actual assertion that was sent
442 * @param toTheoryId the theory that is on the receiving end
443 * @param fromTheoryId the theory that sent the assertion
444 * @return true if a new assertion, false if theory already got it
445 */
446 bool markPropagation(TNode assertion, TNode originalAssertions, theory::TheoryId toTheoryId, theory::TheoryId fromTheoryId);
447
448 /**
449 * Computes the explanation by traversing the propagation graph and
450 * asking relevant theories to explain the propagations. Initially
451 * the explanation vector should contain only the element (node, theory)
452 * where the node is the one to be explained, and the theory is the
453 * theory that sent the literal.
454 */
455 theory::TrustNode getExplanation(
456 std::vector<NodeTheoryPair>& explanationVector);
457
458 /** Are proofs enabled? */
459 bool isProofEnabled() const;
460
461 public:
462 /**
463 * Signal the start of a new round of assertion preprocessing
464 */
465 void preprocessStart();
466
467 /**
468 * Runs theory specific preprocessing on the non-Boolean parts of
469 * the formula. This is only called on input assertions, after ITEs
470 * have been removed.
471 */
472 Node preprocess(TNode node);
473
474 /** Notify (preprocessed) assertions. */
475 void notifyPreprocessedAssertions(const std::vector<Node>& assertions);
476
477 /** Return whether or not we are incomplete (in the current context). */
478 inline bool isIncomplete() const { return d_incomplete; }
479
480 /**
481 * Returns true if we need another round of checking. If this
482 * returns true, check(FULL_EFFORT) _must_ be called by the
483 * propositional layer before reporting SAT.
484 *
485 * This is especially necessary for incomplete theories that lazily
486 * output some lemmas on FULL_EFFORT check (e.g. quantifier reasoning
487 * outputing quantifier instantiations). In such a case, a lemma can
488 * be asserted that is simplified away (perhaps it's already true).
489 * However, we must maintain the invariant that, if a theory uses the
490 * OutputChannel, it implicitly requests that another check(FULL_EFFORT)
491 * be performed before exit, even if no new facts are on its fact queue,
492 * as it might decide to further instantiate some lemmas, precluding
493 * a SAT response.
494 */
495 inline bool needCheck() const {
496 return d_outputChannelUsed || d_lemmasAdded;
497 }
498 /**
499 * Is the literal lit (possibly) critical for satisfying the input formula in
500 * the current context? This call is applicable only during collectModelInfo
501 * or during LAST_CALL effort.
502 */
503 bool isRelevant(Node lit) const;
504 /**
505 * This is called at shutdown time by the SmtEngine, just before
506 * destruction. It is important because there are destruction
507 * ordering issues between PropEngine and Theory.
508 */
509 void shutdown();
510
511 /**
512 * Solve the given literal with a theory that owns it.
513 */
514 theory::Theory::PPAssertStatus solve(TNode literal,
515 theory::SubstitutionMap& substitutionOut);
516
517 /**
518 * Preregister a Theory atom with the responsible theory (or
519 * theories).
520 */
521 void preRegister(TNode preprocessed);
522
523 /**
524 * Assert the formula to the appropriate theory.
525 * @param node the assertion
526 */
527 void assertFact(TNode node);
528
529 /**
530 * Check all (currently-active) theories for conflicts.
531 * @param effort the effort level to use
532 */
533 void check(theory::Theory::Effort effort);
534
535 /**
536 * Calls ppStaticLearn() on all theories, accumulating their
537 * combined contributions in the "learned" builder.
538 */
539 void ppStaticLearn(TNode in, NodeBuilder<>& learned);
540
541 /**
542 * Calls presolve() on all theories and returns true
543 * if one of the theories discovers a conflict.
544 */
545 bool presolve();
546
547 /**
548 * Calls postsolve() on all theories.
549 */
550 void postsolve();
551
552 /**
553 * Calls notifyRestart() on all active theories.
554 */
555 void notifyRestart();
556
557 void getPropagatedLiterals(std::vector<TNode>& literals) {
558 for (; d_propagatedLiteralsIndex < d_propagatedLiterals.size(); d_propagatedLiteralsIndex = d_propagatedLiteralsIndex + 1) {
559 Debug("getPropagatedLiterals") << "TheoryEngine::getPropagatedLiterals: propagating: " << d_propagatedLiterals[d_propagatedLiteralsIndex] << std::endl;
560 literals.push_back(d_propagatedLiterals[d_propagatedLiteralsIndex]);
561 }
562 }
563
564 /**
565 * Returns the next decision request, or null if none exist. The next
566 * decision request is a literal that this theory engine prefers the SAT
567 * solver to make as its next decision. Decision requests are managed by
568 * the decision manager d_decManager.
569 */
570 Node getNextDecisionRequest();
571
572 bool properConflict(TNode conflict) const;
573
574 /**
575 * Returns an explanation of the node propagated to the SAT solver.
576 */
577 theory::TrustNode getExplanation(TNode node);
578
579 /**
580 * Get the pointer to the model object used by this theory engine.
581 */
582 theory::TheoryModel* getModel();
583 /**
584 * Get the current model for the current set of assertions. This method
585 * should only be called immediately after a satisfiable or unknown
586 * response to a check-sat call, and only if produceModels is true.
587 *
588 * If the model is not already built, this will cause this theory engine
589 * to build the model.
590 *
591 * If the model is not available (for instance, if the last call to check-sat
592 * was interrupted), then this returns the null pointer.
593 */
594 theory::TheoryModel* getBuiltModel();
595 /**
596 * This forces the model maintained by the combination engine to be built
597 * if it has not been done so already. This should be called only during a
598 * last call effort check after theory combination is run.
599 *
600 * @return true if the model was successfully built (possibly prior to this
601 * call).
602 */
603 bool buildModel();
604 /** set eager model building
605 *
606 * If this method is called, then this TheoryEngine will henceforth build
607 * its model immediately after every satisfiability check that results
608 * in a satisfiable or unknown result. The motivation for this mode is to
609 * accomodate API users that get the model object from the TheoryEngine,
610 * where we want to ensure that this model is always valid.
611 * TODO (#2648): revisit this.
612 */
613 void setEagerModelBuilding() { d_eager_model_building = true; }
614
615 /** get synth solutions
616 *
617 * This method returns true if there is a synthesis solution available. This
618 * is the case if the last call to check satisfiability originated in a
619 * check-synth call, and the synthesis solver successfully found a solution
620 * for all active synthesis conjectures.
621 *
622 * This method adds entries to sol_map that map functions-to-synthesize with
623 * their solutions, for all active conjectures. This should be called
624 * immediately after the solver answers unsat for sygus input.
625 *
626 * For details on what is added to sol_map, see
627 * SynthConjecture::getSynthSolutions.
628 */
629 bool getSynthSolutions(std::map<Node, std::map<Node, Node> >& sol_map);
630
631 /**
632 * Get the theory associated to a given Node.
633 *
634 * @returns the theory, or NULL if the TNode is
635 * of built-in type.
636 */
637 inline theory::Theory* theoryOf(TNode node) const {
638 return d_theoryTable[theory::Theory::theoryOf(node)];
639 }
640
641 /**
642 * Get the theory associated to a the given theory id.
643 *
644 * @returns the theory
645 */
646 inline theory::Theory* theoryOf(theory::TheoryId theoryId) const {
647 Assert(theoryId < theory::THEORY_LAST);
648 return d_theoryTable[theoryId];
649 }
650
651 inline bool isTheoryEnabled(theory::TheoryId theoryId) const {
652 return d_logicInfo.isTheoryEnabled(theoryId);
653 }
654 /** get the logic info used by this theory engine */
655 const LogicInfo& getLogicInfo() const;
656 /**
657 * Returns the equality status of the two terms, from the theory
658 * that owns the domain type. The types of a and b must be the same.
659 */
660 theory::EqualityStatus getEqualityStatus(TNode a, TNode b);
661
662 /**
663 * Returns the value that a theory that owns the type of var currently
664 * has (or null if none);
665 */
666 Node getModelValue(TNode var);
667
668 /**
669 * Takes a literal and returns an equivalent literal that is guaranteed to be a SAT literal
670 */
671 Node ensureLiteral(TNode n);
672
673 /**
674 * Print all instantiations made by the quantifiers module.
675 */
676 void printInstantiations( std::ostream& out );
677
678 /**
679 * Print solution for synthesis conjectures found by ce_guided_instantiation module
680 */
681 void printSynthSolution( std::ostream& out );
682
683 /**
684 * Get list of quantified formulas that were instantiated
685 */
686 void getInstantiatedQuantifiedFormulas( std::vector< Node >& qs );
687
688 /**
689 * Get instantiation methods
690 * first inputs forall x.q[x] and returns ( q[a], ..., q[z] )
691 * second inputs forall x.q[x] and returns ( a, ..., z )
692 * third and fourth return mappings e.g. forall x.q1[x] -> ( q1[a]...q1[z] )
693 * , ... , forall x.qn[x] -> ( qn[a]...qn[z] )
694 */
695 void getInstantiations( Node q, std::vector< Node >& insts );
696 void getInstantiationTermVectors( Node q, std::vector< std::vector< Node > >& tvecs );
697 void getInstantiations( std::map< Node, std::vector< Node > >& insts );
698 void getInstantiationTermVectors( std::map< Node, std::vector< std::vector< Node > > >& insts );
699
700 /**
701 * Get instantiated conjunction, returns q[t1] ^ ... ^ q[tn] where t1...tn are current set of instantiations for q.
702 * Can be used for quantifier elimination when satisfiable and q[t1] ^ ... ^ q[tn] |= q
703 */
704 Node getInstantiatedConjunction( Node q );
705
706 /**
707 * Forwards an entailment check according to the given theoryOfMode.
708 * See theory.h for documentation on entailmentCheck().
709 */
710 std::pair<bool, Node> entailmentCheck(options::TheoryOfMode mode, TNode lit);
711
712 private:
713
714 /** Dump the assertions to the dump */
715 void dumpAssertions(const char* tag);
716
717 /** For preprocessing pass lifting bit-vectors of size 1 to booleans */
718 public:
719
720 SortInference* getSortInference() { return &d_sortInfer; }
721
722 /** Prints the assertions to the debug stream */
723 void printAssertions(const char* tag);
724
725 private:
726
727 std::map< std::string, std::vector< theory::Theory* > > d_attr_handle;
728
729 public:
730 /** Set user attribute.
731 *
732 * This function is called when an attribute is set by a user. In SMT-LIBv2
733 * this is done via the syntax (! n :attr)
734 */
735 void setUserAttribute(const std::string& attr,
736 Node n,
737 const std::vector<Node>& node_values,
738 const std::string& str_value);
739
740 /** Handle user attribute.
741 *
742 * Associates theory t with the attribute attr. Theory t will be
743 * notified whenever an attribute of name attr is set.
744 */
745 void handleUserAttribute(const char* attr, theory::Theory* t);
746
747 /**
748 * Check that the theory assertions are satisfied in the model.
749 * This function is called from the smt engine's checkModel routine.
750 */
751 void checkTheoryAssertionsWithModel(bool hardFailure);
752
753 private:
754 IntStat d_arithSubstitutionsAdded;
755
756 };/* class TheoryEngine */
757
758 }/* CVC4 namespace */
759
760 #endif /* CVC4__THEORY_ENGINE_H */