GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/smt/dump_manager.cpp Lines: 26 26 100.0 %
Date: 2021-03-23 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
9622
DumpManager::DumpManager(context::UserContext* u)
25
    : d_fullyInited(false),
26
9622
      d_dumpCommands()
27
{
28
9622
}
29
30
19202
DumpManager::~DumpManager()
31
{
32
9601
  d_dumpCommands.clear();
33
9601
}
34
35
8997
void DumpManager::finishInit()
36
{
37
8997
  Trace("smt-debug") << "Dump declaration commands..." << std::endl;
38
  // dump out any pending declaration commands
39
9005
  for (size_t i = 0, ncoms = d_dumpCommands.size(); i < ncoms; ++i)
40
  {
41
8
    Dump("declarations") << *d_dumpCommands[i];
42
  }
43
8997
  d_dumpCommands.clear();
44
45
8997
  d_fullyInited = true;
46
8997
}
47
36
void DumpManager::resetAssertions()
48
{
49
  // currently, do nothing
50
36
}
51
52
280722
void DumpManager::addToDump(const NodeCommand& c, const char* dumpTag)
53
{
54
280722
  Trace("smt") << "SMT addToDump(" << c << ")" << std::endl;
55
280722
  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
280722
}
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
26685
}  // namespace CVC4