1 /********************* */
2 /*! \file equality_engine_notify.h
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Morgan Deters, 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 virtual class for notifications from the equality engine.
15 #include "cvc4_private.h"
17 #ifndef CVC4__THEORY__UF__EQUALITY_ENGINE_NOTIFY_H
18 #define CVC4__THEORY__UF__EQUALITY_ENGINE_NOTIFY_H
20 #include "expr/node.h"
27 * Interface for equality engine notifications. All the notifications
28 * are safe as TNodes, but not necessarily for negations.
30 class EqualityEngineNotify
33 virtual ~EqualityEngineNotify(){};
36 * Notifies about a trigger predicate that became true or false. Notice that
37 * predicate can be an equality.
39 * @param predicate the trigger predicate that became true or false
40 * @param value the value of the predicate
42 virtual bool eqNotifyTriggerPredicate(TNode predicate
, bool value
) = 0;
45 * Notifies about the merge of two trigger terms.
47 * @param tag the theory that both triggers were tagged with
48 * @param t1 a term marked as trigger
49 * @param t2 a term marked as trigger
50 * @param value true if equal, false if dis-equal
52 virtual bool eqNotifyTriggerTermEquality(TheoryId tag
,
58 * Notifies about the merge of two constant terms. After this, all work is
59 * suspended and all you can do is ask for explanations.
61 * @param t1 a constant term
62 * @param t2 a constant term
64 virtual void eqNotifyConstantTermMerge(TNode t1
, TNode t2
) = 0;
67 * Notifies about the creation of a new equality class.
69 * @param t the term forming the new class
71 virtual void eqNotifyNewClass(TNode t
) = 0;
74 * Notifies about the merge of two classes (just after the merge).
79 virtual void eqNotifyMerge(TNode t1
, TNode t2
) = 0;
82 * Notifies about the disequality of two terms.
86 * @param reason the reason
88 virtual void eqNotifyDisequal(TNode t1
, TNode t2
, TNode reason
) = 0;
90 }; /* class EqualityEngineNotify */
93 * Implementation of the notification interface that ignores all the
96 class EqualityEngineNotifyNone
: public EqualityEngineNotify
99 bool eqNotifyTriggerPredicate(TNode predicate
, bool value
) override
103 bool eqNotifyTriggerTermEquality(TheoryId tag
,
110 void eqNotifyConstantTermMerge(TNode t1
, TNode t2
) override
{}
111 void eqNotifyNewClass(TNode t
) override
{}
112 void eqNotifyMerge(TNode t1
, TNode t2
) override
{}
113 void eqNotifyDisequal(TNode t1
, TNode t2
, TNode reason
) override
{}
114 }; /* class EqualityEngineNotifyNone */
117 } // Namespace theory