summaryrefslogtreecommitdiff
path: root/src/smt/env_obj.h
blob: 75b97fda9aea78eeeed60d268073ca69cb16bd49 (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
82
83
84
85
86
87
88
89
90
91
92
93
/******************************************************************************
 * Top contributors (to current version):
 *   Aina Niemetz
 *
 * 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 base class for everything that nees access to the environment (Env)
 * instance, which gives access to global utilities available to internal code.
 */

#include "cvc5_private.h"

#ifndef CVC5__SMT__ENV_OBJ_H
#define CVC5__SMT__ENV_OBJ_H

#include <memory>

#include "expr/node.h"

namespace cvc5 {

class Env;
class LogicInfo;
class NodeManager;
class Options;
class StatisticsRegistry;

namespace context {
class Context;
class UserContext;
}  // namespace context

class EnvObj
{
 protected:
  /** Constructor. */
  EnvObj(Env& env);
  EnvObj() = delete;
  /** Destructor.  */
  virtual ~EnvObj() {}

  /**
   * Rewrite a node.
   * This is a wrapper around theory::Rewriter::rewrite via Env.
   */
  Node rewrite(TNode node) const;
  /**
   * Extended rewrite a node.
   * This is a wrapper around theory::Rewriter::extendedRewrite via Env.
   */
  Node extendedRewrite(TNode node, bool aggr = true) const;
  /**
   * Evaluate node n under the substitution args -> vals.
   * This is a wrapper about theory::Rewriter::evaluate via Env.
   */
  Node evaluate(TNode n,
                const std::vector<Node>& args,
                const std::vector<Node>& vals,
                bool useRewriter = true) const;
  /** Same as above, with a visited cache. */
  Node evaluate(TNode n,
                const std::vector<Node>& args,
                const std::vector<Node>& vals,
                const std::unordered_map<Node, Node>& visited,
                bool useRewriter = true) const;

  /** Get the current logic information. */
  const LogicInfo& logicInfo() const;

  /** Get the options object (const version only) via Env. */
  const Options& options() const;

  /** Get a pointer to the Context via Env. */
  context::Context* context() const;

  /** Get a pointer to the UserContext via Env. */
  context::UserContext* userContext() const;

  /** Get the statistics registry via Env. */
  StatisticsRegistry& statisticsRegistry() const;

  /** The associated environment. */
  Env& d_env;
};

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