summaryrefslogtreecommitdiff
path: root/src/smt/dump_manager.h
blob: 519b9311099d808f8fd3d34a5d0d0f784c8d4770 (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
/*********************                                                        */
/*! \file dump_manager.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Andrew Reynolds, Morgan Deters, Gereon Kremer
 ** This file is part of the CVC4 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.\endverbatim
 **
 ** \brief The dump manager of the SmtEngine.
 **/

#include "cvc4_private.h"

#ifndef CVC4__SMT__DUMP_MANAGER_H
#define CVC4__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 SmtEngine::finishInit, which is triggered
   * when initialization of options is finished.
   */
  void finishInit();
  /**
   * Reset assertions, called on SmtEngine::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 SmtEngine 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