GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bv/theory_bv.h Lines: 0 1 0.0 %
Date: 2021-05-22 Branches: 0 2 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner, Tim King
4
 *
5
 * This file is part of the cvc5 project.
6
 *
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.
11
 * ****************************************************************************
12
 *
13
 * Theory of bit-vectors.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__BV__THEORY_BV_H
19
#define CVC5__THEORY__BV__THEORY_BV_H
20
21
#include "theory/bv/theory_bv_rewriter.h"
22
#include "theory/theory.h"
23
#include "theory/theory_eq_notify.h"
24
#include "theory/theory_state.h"
25
26
namespace cvc5 {
27
28
class ProofRuleChecker;
29
30
namespace theory {
31
namespace bv {
32
33
class BVSolver;
34
35
class TheoryBV : public Theory
36
{
37
  /* BVSolverLazy accesses methods from theory in a way that is deprecated and
38
   * will be removed in the future. For now we allow direct access. */
39
  friend class BVSolverLazy;
40
41
 public:
42
  TheoryBV(context::Context* c,
43
           context::UserContext* u,
44
           OutputChannel& out,
45
           Valuation valuation,
46
           const LogicInfo& logicInfo,
47
           ProofNodeManager* pnm = nullptr,
48
           std::string name = "");
49
50
  ~TheoryBV();
51
52
  /** get the official theory rewriter of this theory */
53
  TheoryRewriter* getTheoryRewriter() override;
54
  /** get the proof checker of this theory */
55
  ProofRuleChecker* getProofChecker() override;
56
57
  /**
58
   * Returns true if we need an equality engine. If so, we initialize the
59
   * information regarding how it should be setup. For details, see the
60
   * documentation in Theory::needsEqualityEngine.
61
   */
62
  bool needsEqualityEngine(EeSetupInfo& esi) override;
63
64
  void finishInit() override;
65
66
  void preRegisterTerm(TNode n) override;
67
68
  bool preCheck(Effort e) override;
69
70
  void postCheck(Effort e) override;
71
72
  bool preNotifyFact(TNode atom,
73
                     bool pol,
74
                     TNode fact,
75
                     bool isPrereg,
76
                     bool isInternal) override;
77
78
  void notifyFact(TNode atom, bool pol, TNode fact, bool isInternal) override;
79
80
  bool needsCheckLastEffort() override;
81
82
  void propagate(Effort e) override;
83
84
  TrustNode explain(TNode n) override;
85
86
  /** Collect model values in m based on the relevant terms given by termSet */
87
  bool collectModelValues(TheoryModel* m,
88
                          const std::set<Node>& termSet) override;
89
90
  std::string identify() const override { return std::string("TheoryBV"); }
91
92
  PPAssertStatus ppAssert(TrustNode in,
93
                          TrustSubstitutionMap& outSubstitutions) override;
94
95
  TrustNode ppRewrite(TNode t, std::vector<SkolemLemma>& lems) override;
96
97
  void ppStaticLearn(TNode in, NodeBuilder& learned) override;
98
99
  void presolve() override;
100
101
  EqualityStatus getEqualityStatus(TNode a, TNode b) override;
102
103
  /** Called by abstraction preprocessing pass. */
104
  bool applyAbstraction(const std::vector<Node>& assertions,
105
                        std::vector<Node>& new_assertions);
106
107
 private:
108
  void notifySharedTerm(TNode t) override;
109
110
  /** Internal BV solver. */
111
  std::unique_ptr<BVSolver> d_internal;
112
113
  /** The theory rewriter for this theory. */
114
  TheoryBVRewriter d_rewriter;
115
116
  /** A (default) theory state object */
117
  TheoryState d_state;
118
119
  /** A (default) theory inference manager. */
120
  TheoryInferenceManager d_im;
121
122
  /** The notify class for equality engine. */
123
  TheoryEqNotifyClass d_notify;
124
125
  /** TheoryBV statistics. */
126
  struct Statistics
127
  {
128
    Statistics(const std::string& name);
129
    IntStat d_solveSubstitutions;
130
  } d_stats;
131
132
}; /* class TheoryBV */
133
134
}  // namespace bv
135
}  // namespace theory
136
}  // namespace cvc5
137
138
#endif /* CVC5__THEORY__BV__THEORY_BV_H */