1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mathias Preiner, Haniel Barbosa, Andrew Reynolds |
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 |
|
* Bit-blast solver that sends bit-blast lemmas directly to the internal |
14 |
|
* MiniSat. |
15 |
|
*/ |
16 |
|
|
17 |
|
#include "cvc5_private.h" |
18 |
|
|
19 |
|
#ifndef CVC5__THEORY__BV__BV_SOLVER_BITBLAST_INTERNAL_H |
20 |
|
#define CVC5__THEORY__BV__BV_SOLVER_BITBLAST_INTERNAL_H |
21 |
|
|
22 |
|
#include "theory/bv/bitblast/proof_bitblaster.h" |
23 |
|
#include "theory/bv/bv_solver.h" |
24 |
|
#include "theory/bv/proof_checker.h" |
25 |
|
|
26 |
|
namespace cvc5 { |
27 |
|
namespace theory { |
28 |
|
namespace bv { |
29 |
|
|
30 |
|
/** |
31 |
|
* Bit-blasting solver that sends bit-blasting lemmas directly to the |
32 |
|
* internal MiniSat. It is also ablo to handle atoms of kind |
33 |
|
* BITVECTOR_EAGER_ATOM. |
34 |
|
* |
35 |
|
* Sends lemmas atom <=> bb(atom) to MiniSat on preNotifyFact(). |
36 |
|
*/ |
37 |
|
class BVSolverBitblastInternal : public BVSolver |
38 |
|
{ |
39 |
|
public: |
40 |
|
BVSolverBitblastInternal(TheoryState* state, |
41 |
|
TheoryInferenceManager& inferMgr, |
42 |
|
ProofNodeManager* pnm); |
43 |
7484 |
~BVSolverBitblastInternal() = default; |
44 |
|
|
45 |
3742 |
bool needsEqualityEngine(EeSetupInfo& esi) override { return true; } |
46 |
|
|
47 |
212112 |
void preRegisterTerm(TNode n) override {} |
48 |
|
|
49 |
|
bool preNotifyFact(TNode atom, |
50 |
|
bool pol, |
51 |
|
TNode fact, |
52 |
|
bool isPrereg, |
53 |
|
bool isInternal) override; |
54 |
|
|
55 |
|
std::string identify() const override { return "BVSolverBitblastInternal"; }; |
56 |
|
|
57 |
|
bool collectModelValues(TheoryModel* m, |
58 |
|
const std::set<Node>& termSet) override; |
59 |
|
|
60 |
|
Node getValue(TNode node, bool initialize) override; |
61 |
|
|
62 |
|
/** get the proof checker of this theory */ |
63 |
|
BVProofRuleChecker* getProofChecker(); |
64 |
|
|
65 |
|
private: |
66 |
|
/** |
67 |
|
* Sends a bit-blasting lemma fact <=> d_bitblaster.bbAtom(fact) to the |
68 |
|
* inference manager. |
69 |
|
*/ |
70 |
|
void addBBLemma(TNode fact); |
71 |
|
|
72 |
|
/** Proof node manager. */ |
73 |
|
ProofNodeManager* d_pnm; |
74 |
|
/** Bit-blaster used to bit-blast atoms/terms. */ |
75 |
|
std::unique_ptr<BBProof> d_bitblaster; |
76 |
|
/** Proof rule checker */ |
77 |
|
BVProofRuleChecker d_checker; |
78 |
|
}; |
79 |
|
|
80 |
|
} // namespace bv |
81 |
|
} // namespace theory |
82 |
|
} // namespace cvc5 |
83 |
|
|
84 |
|
#endif |