summaryrefslogtreecommitdiff
path: root/src/smt/dump_manager.h
blob: b6e0ccfa2a864eb0f123dcb32b5db94788ebe26c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/******************************************************************************
 * Top contributors (to current version):
 *   Andrew Reynolds, Morgan Deters, Gereon Kremer
 *
 * This file is part of the cvc5 project.
 *
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
 * in the top-level source directory and their institutional affiliations.
 * All rights reserved.  See the file COPYING in the top-level source
 * directory for licensing information.
 * ****************************************************************************
 *
 * The dump manager of the SolverEngine.
 */

#include "cvc5_private.h"

#ifndef CVC5__SMT__DUMP_MANAGER_H
#define CVC5__SMT__DUMP_MANAGER_H

#include <memory>
#include <vector>

#include "expr/node.h"

namespace cvc5 {

class NodeCommand;

namespace context {
class UserContext;
}

namespace smt {

/**
 * This utility is responsible for:
 * implementing some dumping traces e.g. --dump=declarations.
 */
class DumpManager
{

 public:
  DumpManager(context::UserContext* u);
  ~DumpManager();
  /**
   * Finish init, called during SolverEngine::finishInit, which is triggered
   * when initialization of options is finished.
   */
  void finishInit();
  /**
   * Reset assertions, called on SolverEngine::resetAssertions.
   */
  void resetAssertions();
  /**
   * Add to dump command.  This is used for recording a command
   * that should be reported via the dumpTag trace.
   */
  void addToDump(const NodeCommand& c, const char* dumpTag = "declarations");

  /**
   * Set that function f should print in the model if and only if p is true.
   */
  void setPrintFuncInModel(Node f, bool p);

 private:
  /** Fully inited */
  bool d_fullyInited;
  /**
   * A vector of declaration commands waiting to be dumped out.
   * Once the SolverEngine is fully initialized, we'll dump them.
   * This ensures the declarations come after the set-logic and
   * any necessary set-option commands are dumped.
   */
  std::vector<std::unique_ptr<NodeCommand>> d_dumpCommands;
};

}  // namespace smt
}  // namespace cvc5

#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback