Simplify and fix check models (#5685)
[cvc5.git] / src / smt / listeners.h
1 /********************* */
2 /*! \file listeners.h
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Abdalrhman Mohamed, Mathias Preiner
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 Listener classes for SMT engine.
13 **/
14
15 #include "cvc4_private.h"
16
17 #ifndef CVC4__SMT__LISTENERS_H
18 #define CVC4__SMT__LISTENERS_H
19
20 #include <vector>
21
22 #include "base/listener.h"
23 #include "expr/node.h"
24
25 namespace CVC4 {
26
27 class OutputManager;
28 class SmtEngine;
29
30 namespace smt {
31
32 /** A listener for resource outs */
33 class ResourceOutListener : public Listener
34 {
35 public:
36 ResourceOutListener(SmtEngine& smt);
37 /** notify method, interupts SmtEngine */
38 void notify() override;
39
40 private:
41 /** Reference to the SmtEngine */
42 SmtEngine& d_smt;
43 };
44
45 class DumpManager;
46
47 /**
48 * A listener for node manager calls, which impacts certain dumping traces.
49 */
50 class SmtNodeManagerListener : public NodeManagerListener
51 {
52 public:
53 SmtNodeManagerListener(DumpManager& dm, OutputManager& outMgr);
54 /** Notify when new sort is created */
55 void nmNotifyNewSort(TypeNode tn, uint32_t flags) override;
56 /** Notify when new sort constructor is created */
57 void nmNotifyNewSortConstructor(TypeNode tn, uint32_t flags) override;
58 /** Notify when list of datatypes is created */
59 void nmNotifyNewDatatypes(const std::vector<TypeNode>& dtts,
60 uint32_t flags) override;
61 /** Notify when new variable is created */
62 void nmNotifyNewVar(TNode n, uint32_t flags) override;
63 /** Notify when new skolem is created */
64 void nmNotifyNewSkolem(TNode n,
65 const std::string& comment,
66 uint32_t flags) override;
67 /** Notify when a term is deleted */
68 void nmNotifyDeleteNode(TNode n) override {}
69
70 private:
71 /** Reference to the dump manager of smt engine */
72 DumpManager& d_dm;
73 /** Reference to the output manager of the smt engine */
74 OutputManager& d_outMgr;
75 };
76
77 } // namespace smt
78 } // namespace CVC4
79
80 #endif