PreprocessingPassResult BvEagerAtoms::applyInternal(
AssertionPipeline* assertionsToPreprocess)
{
- theory::TheoryModel* tm = d_preprocContext->getTheoryEngine()->getModel();
NodeManager* nm = NodeManager::currentNM();
for (unsigned i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
{
TNode atom = (*assertionsToPreprocess)[i];
Node eager_atom = nm->mkNode(kind::BITVECTOR_EAGER_ATOM, atom);
- tm->addSubstitution(eager_atom, atom);
+ d_preprocContext->addModelSubstitution(eager_atom, atom);
assertionsToPreprocess->replace(i, eager_atom);
}
return PreprocessingPassResult::NO_CONFLICT;
<< "unexpected solution from arith's ppAssert()";
Assert(nullMap.empty())
<< "unexpected substitution from arith's ppAssert()";
- te->getModel()->addSubstitution(*ii, newVar.eqNode(one));
+ d_preprocContext->addModelSubstitution(*ii, newVar.eqNode(one));
newVars.push_back(newVar);
varRef = newVar;
}
}
// add substitutions to model, or as assertions if needed (when incremental)
- TheoryModel* m = d_preprocContext->getTheoryEngine()->getModel();
- Assert(m != nullptr);
NodeManager* nm = NodeManager::currentNM();
for (SubstitutionMap::iterator pos = nss.begin(); pos != nss.end(); ++pos)
{
{
Trace("non-clausal-simplify")
<< "substitute: " << lhs << " " << rhs << std::endl;
- m->addSubstitution(lhs, rhs);
+ d_preprocContext->addModelSubstitution(lhs, rhs);
}
else
{
#include "preprocessing/preprocessing_pass_context.h"
#include "expr/node_algorithm.h"
+#include "theory/theory_engine.h"
+#include "theory/theory_model.h"
namespace cvc5 {
namespace preprocessing {
}
}
+void PreprocessingPassContext::addModelSubstitution(const Node& lhs,
+ const Node& rhs)
+{
+ getTheoryEngine()->getModel()->addSubstitution(
+ lhs, d_smt->expandDefinitions(rhs, false));
+}
+
ProofNodeManager* PreprocessingPassContext::getProofNodeManager()
{
return d_pnm;
*/
void recordSymbolsInAssertions(const std::vector<Node>& assertions);
+ /**
+ * Add substitution to theory model.
+ * @param lhs The node replaced by node 'rhs'
+ * @param rhs The node to substitute node 'lhs'
+ */
+ void addModelSubstitution(const Node& lhs, const Node& rhs);
+
/** The the proof node manager associated with this context, if it exists */
ProofNodeManager* getProofNodeManager();
regress0/issue5187-div-justification.smt2
regress0/issue5370.smt2
regress0/issue5462.smt2
+ regress0/issue5473.smt2
regress0/issue5540-2-dump-model.smt2
regress0/issue5540-model-decls.smt2
regress0/issue5550-num-children.smt2
+% COMMAND-LINE: -q
% EXPECT: not_entailed
DATATYPE
nat = succ(pred : nat) | zero,
--- /dev/null
+; COMMAND-LINE: -q
+; EXPECT: sat
+; EXPECT: ((baz true))
+(set-logic QF_NIRA)
+(set-option :produce-models true)
+(declare-fun a () Int)
+(declare-fun b () Int)
+(assert (! (or (= a (div 0 b))) :named baz))
+(assert (and (< b 5)))
+(check-sat)
+(get-assignment)