* If was explicitly called
* Then it was implicitly called when CreateTerm ran.
* Then it was implicitly called again when CombineLikeTerms called CreateTerm.
Remove an unecessary flatten.
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@981
e59a4935-1847-0410-ae03-
e826735625c1
fixedMap = new NodeToFixedBitsMap(1000); // better to use the function that returns the number of nodes.. whatever that is.
workList = new WorkList(top);
dependents = new Dependencies(top); // List of the parents of a node.
- msm = NULL;
- //msm = new MultiplicationStatsMap();
+ msm = new MultiplicationStatsMap();
// not fixing the topnode.
// safe approximation to no overflow multiplication.
if (k == BVMULT)
{
- //MultiplicationStats ms;
- //result = bvMultiplyBothWays(children, output, n.GetSTPMgr(),&ms);
- result = bvMultiplyBothWays(children, output, n.GetSTPMgr());
- // if (CONFLICT != result)
- // msm->map[n] = ms;
+ MultiplicationStats ms;
+ result = bvMultiplyBothWays(children, output, n.GetSTPMgr(),&ms);
+ if (CONFLICT != result)
+ msm->map[n] = ms;
mult_like=true;
}
else if (k == BVDIV)
Result status;
WorkList *workList;
Dependencies * dependents;
- MultiplicationStatsMap* msm;
bool topFixed;
public:
NodeToFixedBitsMap* fixedMap;
+ MultiplicationStatsMap* msm;
bool isUnsatisfiable()
{
void
print()
{
- ostream& log = std::cout;
+ ostream& log = std::cerr;
log << x << " * " << y << "=" << r << endl;
else // pluss.
{
assert(BVPLUS == k);
- SortByArith(nonconstkids);
- output = nf->CreateTerm(k, inputValueWidth, nonconstkids);
- output = Flatten(output);
- output = CombineLikeTerms(output);
+ //SortByArith(nonconstkids);
+ //output = nf->CreateTerm(k, inputValueWidth, nonconstkids);
+ //output = Flatten(output);
+ //output = CombineLikeTerms(output);
+ output = CombineLikeTerms(nonconstkids);
}
}
else
return output;
}
- const ASTVec& c = a.GetChildren();
- //map from variables to vector of constants
+ return CombineLikeTerms(a.GetChildren());
+ }
+
+ ASTNode Simplifier::CombineLikeTerms(const ASTVec& c)
+ {
+ ASTNode output;
+ //map from variables to vector of constants
ASTNodeToVecMap vars_to_consts;
//vector to hold constants
ASTVec constkids;
ASTNode FlattenAndOr(const ASTNode& a);
ASTNode CombineLikeTerms(const ASTNode& a);
+ ASTNode CombineLikeTerms(const ASTVec& a);
ASTNode LhsMinusRhs(const ASTNode& eq);