1 /********************* */
2 /*! \file engine_output_channel.h
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Tim King, Dejan Jovanovic
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
,
49 std::unique_ptr
<Proof
> pf
= nullptr) override
;
50 bool propagate(TNode literal
) override
;
52 theory::LemmaStatus
lemma(TNode lemma
,
54 bool removable
= false,
55 bool preprocess
= false,
56 bool sendAtoms
= false) override
;
58 theory::LemmaStatus
splitLemma(TNode lemma
, bool removable
= false) override
;
60 void demandRestart() override
;
62 void requirePhase(TNode n
, bool phase
) override
;
64 void setIncomplete() override
;
66 void spendResource(ResourceManager::Resource r
) override
;
68 void handleUserAttribute(const char* attr
, theory::Theory
* t
) override
;
71 * Let pconf be the pair (Node conf, ProofGenerator * pfg). This method
72 * sends conf on the output channel of this class whose proof can be generated
73 * by the generator pfg. Apart from pfg, the interface for this method is
74 * the same as calling OutputChannel::lemma on conf.
76 void trustedConflict(TrustNode pconf
) override
;
78 * Let plem be the pair (Node lem, ProofGenerator * pfg).
79 * Send lem on the output channel of this class whose proof can be generated
80 * by the generator pfg. Apart from pfg, the interface for this method is
81 * the same as calling OutputChannel::lemma on lem.
83 LemmaStatus
trustedLemma(TrustNode plem
,
84 bool removable
= false,
85 bool preprocess
= false,
86 bool sendAtoms
= false) override
;
90 * Statistics for a particular theory.
95 Statistics(theory::TheoryId theory
);
97 /** Number of calls to conflict, propagate, lemma, requirePhase,
99 IntStat conflicts
, propagations
, lemmas
, requirePhase
, restartDemands
,
100 trustedConflicts
, trustedLemmas
;
102 /** The theory engine we're communicating with. */
103 TheoryEngine
* d_engine
;
104 /** The statistics of the theory interractions. */
105 Statistics d_statistics
;
106 /** The theory owning this channel. */
107 theory::TheoryId d_theory
;
108 /** A helper function for registering lemma recipes with the proof engine */
109 void registerLemmaRecipe(Node lemma
,
112 theory::TheoryId theoryId
);
115 } // namespace theory
118 #endif /* CVC4__THEORY__ENGINE_OUTPUT_CHANNEL_H */