1 /********************* */
3 ** Original author: mdeters
4 ** Major contributors: none
5 ** Minor contributors (to current version): none
6 ** This file is part of the CVC4 prototype.
7 ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
8 ** Courant Institute of Mathematical Sciences
10 ** See the file COPYING in the top-level source directory for licensing
13 ** The theory output channel interface.
16 #ifndef __CVC4__THEORY__OUTPUT_CHANNEL_H
17 #define __CVC4__THEORY__OUTPUT_CHANNEL_H
19 #include "theory/interrupted.h"
25 * Generic "theory output channel" interface.
31 * Destructs an OutputChannel. This implementation does nothing,
32 * but we need a virtual destructor for safety in case subclasses
35 virtual ~OutputChannel() {
39 * With safePoint(), the theory signals that it is at a safe point
40 * and can be interrupted.
42 virtual void safePoint() throw(Interrupted
&) {
46 * Indicate a theory conflict has arisen.
48 * @param n - a conflict at the current decision level
49 * @param safe - whether it is safe to be interrupted
51 virtual void conflict(Node n
, bool safe
= false) throw(Interrupted
&) = 0;
54 * Propagate a theory literal.
56 * @param n - a theory consequence at the current decision level
57 * @param safe - whether it is safe to be interrupted
59 virtual void propagate(Node n
, bool safe
= false) throw(Interrupted
&) = 0;
62 * Tell the core that a valid theory lemma at decision level 0 has
63 * been detected. (This request a split.)
65 * @param n - a theory lemma valid at decision level 0
66 * @param safe - whether it is safe to be interrupted
68 virtual void lemma(Node n
, bool safe
= false) throw(Interrupted
&) = 0;
70 };/* class OutputChannel */
73 * Generic "theory output channel" interface for explanations.
75 class ExplainOutputChannel
{
79 * Destructs an ExplainOutputChannel. This implementation does
80 * nothing, but we need a virtual destructor for safety in case
81 * subclasses have a destructor.
83 virtual ~ExplainOutputChannel() {
87 * With safePoint(), the theory signals that it is at a safe point
88 * and can be interrupted. The default implementation never
91 virtual void safePoint() throw(Interrupted
&) {
95 * Provide an explanation in response to an explanation request.
97 * @param n - an explanation
98 * @param safe - whether it is safe to be interrupted
100 virtual void explanation(Node n
, bool safe
= false) throw(Interrupted
&) = 0;
101 };/* class ExplainOutputChannel */
103 }/* CVC4::theory namespace */
104 }/* CVC4 namespace */
106 #endif /* __CVC4__THEORY__OUTPUT_CHANNEL_H */