1 /********************* */
4 ** Top contributors (to current version):
5 ** Mathias Preiner, Andrew Reynolds
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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
12 ** \brief Bit-vector solver interface.
14 ** Describes the interface for the internal bit-vector solver of TheoryBV.
17 #include "cvc4_private.h"
19 #ifndef CVC4__THEORY__BV__BV_SOLVER_H
20 #define CVC4__THEORY__BV__BV_SOLVER_H
22 #include "theory/theory.h"
31 BVSolver(TheoryState
& state
, TheoryInferenceManager
& inferMgr
)
32 : d_state(state
), d_im(inferMgr
){};
34 virtual ~BVSolver(){};
37 * Returns true if we need an equality engine. If so, we initialize the
38 * information regarding how it should be setup. For details, see the
39 * documentation in Theory::needsEqualityEngine.
41 virtual bool needsEqualityEngine(EeSetupInfo
& esi
) { return false; }
43 virtual void finishInit(){};
45 virtual void preRegisterTerm(TNode n
) = 0;
48 * Forwarded from TheoryBV::preCheck().
50 virtual bool preCheck(Theory::Effort level
= Theory::Effort::EFFORT_FULL
)
55 * Forwarded from TheoryBV::postCheck().
57 virtual void postCheck(Theory::Effort level
= Theory::Effort::EFFORT_FULL
){};
59 * Forwarded from TheoryBV:preNotifyFact().
61 virtual bool preNotifyFact(
62 TNode atom
, bool pol
, TNode fact
, bool isPrereg
, bool isInternal
)
67 * Forwarded from TheoryBV::notifyFact().
69 virtual void notifyFact(TNode atom
, bool pol
, TNode fact
, bool isInternal
) {}
71 virtual bool needsCheckLastEffort() { return false; }
73 virtual void propagate(Theory::Effort e
){};
75 virtual TrustNode
explain(TNode n
)
77 Unimplemented() << "BVSolver propagated a node but doesn't implement the "
78 "BVSolver::explain() interface!";
79 return TrustNode::null();
82 /** Collect model values in m based on the relevant terms given by termSet */
83 virtual bool collectModelValues(TheoryModel
* m
,
84 const std::set
<Node
>& termSet
) = 0;
86 virtual std::string
identify() const = 0;
88 virtual Theory::PPAssertStatus
ppAssert(
89 TrustNode in
, TrustSubstitutionMap
& outSubstitutions
) = 0;
91 virtual TrustNode
ppRewrite(TNode t
) { return TrustNode::null(); };
93 virtual void ppStaticLearn(TNode in
, NodeBuilder
<>& learned
){};
95 virtual void presolve(){};
97 virtual void notifySharedTerm(TNode t
) {}
99 virtual EqualityStatus
getEqualityStatus(TNode a
, TNode b
)
101 return EqualityStatus::EQUALITY_UNKNOWN
;
104 /** Called by abstraction preprocessing pass. */
105 virtual bool applyAbstraction(const std::vector
<Node
>& assertions
,
106 std::vector
<Node
>& new_assertions
)
108 new_assertions
.insert(
109 new_assertions
.end(), assertions
.begin(), assertions
.end());
114 TheoryState
& d_state
;
115 TheoryInferenceManager
& d_im
;
119 } // namespace theory
122 #endif /* CVC4__THEORY__BV__BV_SOLVER_H */