fix(library/blast/simplifier): loop rewrite rules
This commit is contained in:
parent
25f507e46f
commit
a304f6a9df
1 changed files with 12 additions and 2 deletions
|
@ -370,8 +370,18 @@ result simplifier::rewrite(expr const & e) {
|
|||
|
||||
list<simp_rule> const * srs = sr->find_simp(e);
|
||||
if (!srs) return r;
|
||||
|
||||
for_each(*srs,[&](simp_rule const & sr) { r = join(r,rewrite(r.get_new(),sr)); });
|
||||
|
||||
bool modified = true;
|
||||
while (modified) {
|
||||
modified = false;
|
||||
for_each(*srs,[&](simp_rule const & sr) {
|
||||
result r_rew = rewrite(r.get_new(),sr);
|
||||
if (r_rew.is_none()) return;
|
||||
r = join(r,r_rew);
|
||||
modified = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue