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

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