6ccc6c7c17890801e967c6630a37220d49d52866
1 /******************************************************************************
2 * Top contributors (to current version):
3 * Mathias Preiner, Andrew Reynolds, Andres Noetzli
5 * This file is part of the cvc5 project.
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 * ****************************************************************************
13 * Bit-vector solver interface.
15 * Describes the interface for the internal bit-vector solver of TheoryBV.
18 #include "cvc5_private.h"
20 #ifndef CVC5__THEORY__BV__BV_SOLVER_H
21 #define CVC5__THEORY__BV__BV_SOLVER_H
23 #include "theory/theory.h"
32 BVSolver(TheoryState
& state
, TheoryInferenceManager
& inferMgr
)
33 : d_state(state
), d_im(inferMgr
){};
35 virtual ~BVSolver() {}
38 * Returns true if we need an equality engine. If so, we initialize the
39 * information regarding how it should be setup. For details, see the
40 * documentation in Theory::needsEqualityEngine.
42 virtual bool needsEqualityEngine(EeSetupInfo
& esi
) { return false; }
44 virtual void finishInit(){};
46 virtual void preRegisterTerm(TNode n
) = 0;
49 * Forwarded from TheoryBV::preCheck().
51 virtual bool preCheck(Theory::Effort level
= Theory::Effort::EFFORT_FULL
)
56 * Forwarded from TheoryBV::postCheck().
58 virtual void postCheck(Theory::Effort level
= Theory::Effort::EFFORT_FULL
){};
60 * Forwarded from TheoryBV:preNotifyFact().
62 virtual bool preNotifyFact(
63 TNode atom
, bool pol
, TNode fact
, bool isPrereg
, bool isInternal
)
68 * Forwarded from TheoryBV::notifyFact().
70 virtual void notifyFact(TNode atom
, bool pol
, TNode fact
, bool isInternal
) {}
72 virtual bool needsCheckLastEffort() { return false; }
74 virtual void propagate(Theory::Effort e
) {}
76 virtual TrustNode
explain(TNode n
)
78 Unimplemented() << "BVSolver propagated a node but doesn't implement the "
79 "BVSolver::explain() interface!";
80 return TrustNode::null();
83 /** Additionally collect terms relevant for collecting model values. */
84 virtual void computeRelevantTerms(std::set
<Node
>& termSet
) {}
86 /** Collect model values in m based on the relevant terms given by termSet */
87 virtual bool collectModelValues(TheoryModel
* m
,
88 const std::set
<Node
>& termSet
) = 0;
90 virtual std::string
identify() const = 0;
92 virtual TrustNode
ppRewrite(TNode t
) { return TrustNode::null(); }
94 virtual void ppStaticLearn(TNode in
, NodeBuilder
& learned
) {}
96 virtual void presolve() {}
98 virtual void notifySharedTerm(TNode t
) {}
100 virtual EqualityStatus
getEqualityStatus(TNode a
, TNode b
)
102 return EqualityStatus::EQUALITY_UNKNOWN
;
105 /** Called by abstraction preprocessing pass. */
106 virtual bool applyAbstraction(const std::vector
<Node
>& assertions
,
107 std::vector
<Node
>& new_assertions
)
109 new_assertions
.insert(
110 new_assertions
.end(), assertions
.begin(), assertions
.end());
115 TheoryState
& d_state
;
116 TheoryInferenceManager
& d_im
;
120 } // namespace theory
123 #endif /* CVC5__THEORY__BV__BV_SOLVER_H */