1 /********************* */
2 /*! \file engine_output_channel.h
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Tim King, Haniel Barbosa
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 The theory engine output channel.
15 #include "cvc4_private.h"
17 #ifndef CVC4__THEORY__ENGINE_OUTPUT_CHANNEL_H
18 #define CVC4__THEORY__ENGINE_OUTPUT_CHANNEL_H
20 #include "expr/node.h"
21 #include "theory/output_channel.h"
22 #include "theory/theory.h"
23 #include "util/statistics_registry.h"
32 * An output channel for Theory that passes messages back to a TheoryEngine
35 * Notice that it has interfaces trustedConflict and trustedLemma which are
36 * used for ensuring that proof generators are associated with the lemmas
37 * and conflicts sent on this output channel.
39 class EngineOutputChannel
: public theory::OutputChannel
41 friend class TheoryEngine
;
44 EngineOutputChannel(TheoryEngine
* engine
, theory::TheoryId theory
);
46 void safePoint(ResourceManager::Resource r
) override
;
48 void conflict(TNode conflictNode
) override
;
49 bool propagate(TNode literal
) override
;
51 theory::LemmaStatus
lemma(TNode lemma
,
52 LemmaProperty p
= LemmaProperty::NONE
) override
;
54 theory::LemmaStatus
splitLemma(TNode lemma
, bool removable
= false) override
;
56 void demandRestart() override
;
58 void requirePhase(TNode n
, bool phase
) override
;
60 void setIncomplete() override
;
62 void spendResource(ResourceManager::Resource r
) override
;
64 void handleUserAttribute(const char* attr
, theory::Theory
* t
) override
;
67 * Let pconf be the pair (Node conf, ProofGenerator * pfg). This method
68 * sends conf on the output channel of this class whose proof can be generated
69 * by the generator pfg. Apart from pfg, the interface for this method is
70 * the same as calling OutputChannel::lemma on conf.
72 void trustedConflict(TrustNode pconf
) override
;
74 * Let plem be the pair (Node lem, ProofGenerator * pfg).
75 * Send lem on the output channel of this class whose proof can be generated
76 * by the generator pfg. Apart from pfg, the interface for this method is
77 * the same as calling OutputChannel::lemma on lem.
79 LemmaStatus
trustedLemma(TrustNode plem
,
80 LemmaProperty p
= LemmaProperty::NONE
) override
;
84 * Statistics for a particular theory.
89 Statistics(theory::TheoryId theory
);
91 /** Number of calls to conflict, propagate, lemma, requirePhase,
93 IntStat conflicts
, propagations
, lemmas
, requirePhase
, restartDemands
,
94 trustedConflicts
, trustedLemmas
;
96 /** The theory engine we're communicating with. */
97 TheoryEngine
* d_engine
;
98 /** The statistics of the theory interractions. */
99 Statistics d_statistics
;
100 /** The theory owning this channel. */
101 theory::TheoryId d_theory
;
102 /** A helper function for registering lemma recipes with the proof engine */
103 void registerLemmaRecipe(Node lemma
,
106 theory::TheoryId theoryId
);
109 } // namespace theory
112 #endif /* CVC4__THEORY__ENGINE_OUTPUT_CHANNEL_H */