// If all the parameters are constant, return the constant value.
// The bitblaster calls CreateNode with a boolean vector. We don't try to simplify those.
- if (kind != BEEV::UNDEFINED)
+ if (kind != BEEV::UNDEFINED && kind != BEEV::BITVECTOR && kind != BEEV::ARRAY)
{
bool allConstant = true;
typedef BEEV::ASTVec nodelist;
typedef BEEV::CompleteCounterExample* CompleteCEStar;
BEEV::ASTVec *decls = NULL;
+SimplifyingNodeFactory *simpNF = NULL;
//vector<BEEV::ASTNode *> created_exprs;
// persist holds a copy of ASTNodes so that the reference count of
bvsolver, arrayTransformer,
tosat, Ctr_Example);
- // This expects the simplifying node factory to be used to create all the nodes.
- // i.e. for sbvdiv to be transformed away. The c-interface uses the hashing node
- // factory. I tried to enable the simplfyingnode factory. But some c-api-tests
- // failed with assertion errors.
- bm->UserFlags.set("bitblast-simplification","0");
+ simpNF = new SimplifyingNodeFactory(*(bm->hashingNodeFactory), *bm);
+ bm->defaultNodeFactory = simpNF;
BEEV::GlobalSTP = stp;
decls = new BEEV::ASTVec();
BEEV::GlobalSTP = NULL;
delete BEEV::ParserBM;
BEEV::ParserBM = NULL;
+ delete simpNF;
}
void vc_DeleteExpr(Expr e) {
if (fromTo.size() > 0)
{
ASTNodeMap cache;
- SimplifyingNodeFactory nf(*(top.GetSTPMgr()->defaultNodeFactory), *top.GetSTPMgr());
+ SimplifyingNodeFactory nf(*(top.GetSTPMgr()->hashingNodeFactory), *top.GetSTPMgr());
bm.GetRunTimes()->stop(RunTimes::IntervalPropagation);
return SubstitutionMap::replace(result,fromTo,cache,&nf);
}
::Expr b2 = ::vc_falseExpr(vc);
::Expr andExpr = ::vc_andExpr(vc, b1, b2);
- if(::getExprKind(andExpr) != ::AND )
- throw new std::runtime_error("sadfas");
-
::Expr simplifiedExpr = ::vc_simplify(vc, andExpr);
if (getExprKind(simplifiedExpr) != ::FALSE )