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