namespace theory {
namespace bv {
-BitblastProofGenerator::BitblastProofGenerator(ProofNodeManager* pnm,
+BitblastProofGenerator::BitblastProofGenerator(Env& env,
+ ProofNodeManager* pnm,
TConvProofGenerator* tcpg)
- : d_pnm(pnm), d_tcpg(tcpg)
+ : EnvObj(env), d_pnm(pnm), d_tcpg(tcpg)
{
}
* sub-terms and recording these bit-blast steps in the conversion proof.
*/
- Node rwt = Rewriter::rewrite(t);
+ Node rwt = rewrite(t);
std::vector<Node> transSteps;
transSteps.push_back(rwt.eqNode(bbt));
// Record post-rewrite of bit-blasted term.
- Node rwbbt = Rewriter::rewrite(bbt);
+ Node rwbbt = rewrite(bbt);
if (bbt != rwbbt)
{
cdp.addStep(bbt.eqNode(rwbbt), PfRule::REWRITE, {}, {bbt});
#include "proof/proof_generator.h"
#include "proof/proof_node_manager.h"
+#include "smt/env_obj.h"
namespace cvc5 {
namespace bv {
/** Proof generator fot bit-blast proofs. */
-class BitblastProofGenerator : public ProofGenerator
+class BitblastProofGenerator : public ProofGenerator, protected EnvObj
{
public:
- BitblastProofGenerator(ProofNodeManager* pnm, TConvProofGenerator* tcpg);
+ BitblastProofGenerator(Env& env,
+ ProofNodeManager* pnm,
+ TConvProofGenerator* tcpg);
~BitblastProofGenerator(){};
/**
d_modelCache.clear();
}
-template <class T>
-Node TBitblaster<T>::getTermModel(TNode node, bool fullModel)
-{
- if (d_modelCache.find(node) != d_modelCache.end()) return d_modelCache[node];
-
- if (node.isConst()) return node;
-
- Node value = getModelFromSatSolver(node, false);
- if (!value.isNull())
- {
- Debug("bv-equality-status")
- << "TLazyBitblaster::getTermModel from SatSolver" << node << " => "
- << value << "\n";
- d_modelCache[node] = value;
- Assert(value.isConst());
- return value;
- }
-
- if (Theory::isLeafOf(node, theory::THEORY_BV))
- {
- // if it is a leaf may ask for fullModel
- value = getModelFromSatSolver(node, true);
- Debug("bv-equality-status") << "TLazyBitblaster::getTermModel from VarValue"
- << node << " => " << value << "\n";
- Assert((fullModel && !value.isNull() && value.isConst()) || !fullModel);
- if (!value.isNull())
- {
- d_modelCache[node] = value;
- }
- return value;
- }
- Assert(node.getType().isBitVector());
-
- NodeBuilder nb(node.getKind());
- if (node.getMetaKind() == kind::metakind::PARAMETERIZED)
- {
- nb << node.getOperator();
- }
-
- for (unsigned i = 0; i < node.getNumChildren(); ++i)
- {
- nb << getTermModel(node[i], fullModel);
- }
- value = nb;
- value = Rewriter::rewrite(value);
- Assert(value.isConst());
- d_modelCache[node] = value;
- Debug("bv-term-model") << "TLazyBitblaster::getTermModel Building Value"
- << node << " => " << value << "\n";
- return value;
-}
-
} // namespace bv
} // namespace theory
} // namespace cvc5
d_tcontext.get(),
false)
: nullptr),
- d_bbpg(pnm ? new BitblastProofGenerator(pnm, d_tcpg.get()) : nullptr),
+ d_bbpg(pnm ? new BitblastProofGenerator(env, pnm, d_tcpg.get())
+ : nullptr),
d_recordFineGrainedProofs(fineGrained)
{
}
NodeManager* nm = NodeManager::currentNM();
// post-rewrite atom
- Node rwNode = Rewriter::rewrite(node);
+ Node rwNode = rewrite(node);
// Post-order traversal of `rwNode` to make sure that all subterms are
// bit-blasted and recorded.
if (newLeft < newRight)
{
- Assert((newRight == left && newLeft == right)
- || Rewriter::rewrite(newRight) != left
- || Rewriter::rewrite(newLeft) != right);
return newRight.eqNode(newLeft);
}
- Assert((newLeft == left && newRight == right)
- || Rewriter::rewrite(newLeft) != left
- || Rewriter::rewrite(newRight) != right);
return newLeft.eqNode(newRight);
}