Fix bug in has_free_vars_fn. Add optimization to type_checker.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3a1514982f
commit
5c6ee647a9
3 changed files with 5 additions and 3 deletions
|
@ -63,7 +63,7 @@ protected:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_set_closed_flag && !result)
|
if (m_set_closed_flag && !result && offset == 0)
|
||||||
e.raw()->set_closed();
|
e.raw()->set_closed();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -128,7 +128,9 @@ struct infer_type_fn {
|
||||||
buffer << "\nin context:\n" << ctx;
|
buffer << "\nin context:\n" << ctx;
|
||||||
throw exception(buffer.str());
|
throw exception(buffer.str());
|
||||||
}
|
}
|
||||||
if (closed(c))
|
if (closed(abst_body(f_t)))
|
||||||
|
f_t = abst_body(f_t);
|
||||||
|
else if (closed(c))
|
||||||
f_t = instantiate_with_closed(abst_body(f_t), c);
|
f_t = instantiate_with_closed(abst_body(f_t), c);
|
||||||
else
|
else
|
||||||
f_t = instantiate(abst_body(f_t), c);
|
f_t = instantiate(abst_body(f_t), c);
|
||||||
|
|
|
@ -89,7 +89,7 @@ static void tst5() {
|
||||||
env.add_var("P", Bool);
|
env.add_var("P", Bool);
|
||||||
expr P = Const("P");
|
expr P = Const("P");
|
||||||
expr H = Const("H");
|
expr H = Const("H");
|
||||||
unsigned n = 500;
|
unsigned n = 4000;
|
||||||
expr prop = P;
|
expr prop = P;
|
||||||
expr pr = H;
|
expr pr = H;
|
||||||
for (unsigned i = 1; i < n; i++) {
|
for (unsigned i = 1; i < n; i++) {
|
||||||
|
|
Loading…
Reference in a new issue