!= and_end; and_child++)
{
- ASTNode r = solveForXOR(!changed?*and_child:_simp->SimplifyFormula(_simp->applySubstitutionMapUntilArrays(*and_child),false,NULL));
+ ASTNode r = solveForXOR(!changed?*and_child:_simp->SimplifyFormula(completelySubstitute? _simp->applySubstitutionMap(*and_child)
+ : _simp->applySubstitutionMapUntilArrays(*and_child),false,NULL));
if (r!=*and_child)
changed=true;
output_children.push_back(r);
//the formula
ASTNode BVSolver::TopLevelBVSolve(const ASTNode& _input)
{
- // if (!wordlevel_solve_flag)
- // {
- // return input;
- // }
+ completelySubstitute = _bm->UserFlags.isSet("full_bvsolve","0");
+ assert (_bm->UserFlags.wordlevel_solve_flag);
ASTNode input = _input;
-
-
ASTNode output = input;
if (CheckAlreadySolvedMap(input, output))
{
return output;
}
+ if (completelySubstitute)
+ input = _simp->applySubstitutionMap(input);
+
+
Kind k = input.GetKind();
if (XOR ==k && _bm->UserFlags.solve_for_XORS_flag)
{
b = write(A,b,b),
which shouldn't be simplified.
*/
- ASTNode aaa = (any_solved && EQ == it->GetKind()) ? _simp->SimplifyFormula(_simp->applySubstitutionMapUntilArrays(*it),false,NULL) : *it;
+
+ ASTNode aaa = (any_solved && EQ == it->GetKind()) ? _simp->SimplifyFormula
+ (completelySubstitute ? _simp->applySubstitutionMap(*it):
+ _simp->applySubstitutionMapUntilArrays(*it),false,NULL) : *it;
if (ASTFalse == aaa)
{
// Imagine in the last conjunct A is replaced by B. But there could
// be variable A's in the first conjunct. This gets rid of 'em.
- output = _simp->applySubstitutionMapUntilArrays(output);
+ if (completelySubstitute)
+ output = _simp->applySubstitutionMap(output);
+ else
+ output = _simp->applySubstitutionMapUntilArrays(output);
+
UpdateAlreadySolvedMap(_input, output);
_bm->GetRunTimes()->stop(RunTimes::BVSolver);
//else returns FALSE
bool CheckAlreadySolvedMap(const ASTNode& key, ASTNode& output);
+ // If array terms contain variables that have been substituted for, then , it breaks.
+ // However, completely substituting is extremely expensive to do. And only rarely necessary.
+ // With this option enabled, it will do it properly. And slowly!!
+ bool completelySubstitute;
public:
//constructor