GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/smt/dump_manager.cpp Lines: 26 26 100.0 %
Date: 2021-08-01 Branches: 28 50 56.0 %

Line Exec Source
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
10481
DumpManager::DumpManager(context::UserContext* u)
26
    : d_fullyInited(false),
27
10481
      d_dumpCommands()
28
{
29
10481
}
30
31
20962
DumpManager::~DumpManager()
32
{
33
10481
  d_dumpCommands.clear();
34
10481
}
35
36
9838
void DumpManager::finishInit()
37
{
38
9838
  Trace("smt-debug") << "Dump declaration commands..." << std::endl;
39
  // dump out any pending declaration commands
40
9846
  for (size_t i = 0, ncoms = d_dumpCommands.size(); i < ncoms; ++i)
41
  {
42
8
    Dump("declarations") << *d_dumpCommands[i];
43
  }
44
9838
  d_dumpCommands.clear();
45
46
9838
  d_fullyInited = true;
47
9838
}
48
71
void DumpManager::resetAssertions()
49
{
50
  // currently, do nothing
51
71
}
52
53
290854
void DumpManager::addToDump(const NodeCommand& c, const char* dumpTag)
54
{
55
290854
  Trace("smt") << "SMT addToDump(" << c << ")" << std::endl;
56
290854
  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
290854
}
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
29280
}  // namespace cvc5