1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds, Gereon Kremer, Morgan Deters |
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 |
|
* Implementation of the dump manager. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "smt/dump_manager.h" |
17 |
|
|
18 |
|
#include "options/smt_options.h" |
19 |
|
#include "smt/dump.h" |
20 |
|
#include "smt/node_command.h" |
21 |
|
|
22 |
|
namespace cvc5 { |
23 |
|
namespace smt { |
24 |
|
|
25 |
10497 |
DumpManager::DumpManager(context::UserContext* u) |
26 |
|
: d_fullyInited(false), |
27 |
10497 |
d_dumpCommands() |
28 |
|
{ |
29 |
10497 |
} |
30 |
|
|
31 |
20994 |
DumpManager::~DumpManager() |
32 |
|
{ |
33 |
10497 |
d_dumpCommands.clear(); |
34 |
10497 |
} |
35 |
|
|
36 |
9853 |
void DumpManager::finishInit() |
37 |
|
{ |
38 |
9853 |
Trace("smt-debug") << "Dump declaration commands..." << std::endl; |
39 |
|
// dump out any pending declaration commands |
40 |
9861 |
for (size_t i = 0, ncoms = d_dumpCommands.size(); i < ncoms; ++i) |
41 |
|
{ |
42 |
8 |
Dump("declarations") << *d_dumpCommands[i]; |
43 |
|
} |
44 |
9853 |
d_dumpCommands.clear(); |
45 |
|
|
46 |
9853 |
d_fullyInited = true; |
47 |
9853 |
} |
48 |
71 |
void DumpManager::resetAssertions() |
49 |
|
{ |
50 |
|
// currently, do nothing |
51 |
71 |
} |
52 |
|
|
53 |
289185 |
void DumpManager::addToDump(const NodeCommand& c, const char* dumpTag) |
54 |
|
{ |
55 |
289185 |
Trace("smt") << "SMT addToDump(" << c << ")" << std::endl; |
56 |
289185 |
if (Dump.isOn(dumpTag)) |
57 |
|
{ |
58 |
10 |
if (d_fullyInited) |
59 |
|
{ |
60 |
2 |
Dump(dumpTag) << c; |
61 |
|
} |
62 |
|
else |
63 |
|
{ |
64 |
8 |
d_dumpCommands.push_back(std::unique_ptr<NodeCommand>(c.clone())); |
65 |
|
} |
66 |
|
} |
67 |
289185 |
} |
68 |
|
|
69 |
20 |
void DumpManager::setPrintFuncInModel(Node f, bool p) |
70 |
|
{ |
71 |
20 |
Trace("setp-model") << "Set printInModel " << f << " to " << p << std::endl; |
72 |
|
// TODO (cvc4-wishues/issues/75): implement |
73 |
20 |
} |
74 |
|
|
75 |
|
} // namespace smt |
76 |
29340 |
} // namespace cvc5 |