feat(library/blast/congruence_closure): allow meta-variables in the congruence closure module after partitions have been frozen

This commit is contained in:
Leonardo de Moura 2015-11-24 18:32:20 -08:00
parent 67a4cd3972
commit 651e3834ba
2 changed files with 6 additions and 2 deletions

View file

@ -16,6 +16,8 @@ action_result assert_cc_action(hypothesis_idx hidx) {
if (!get_config().m_cc) if (!get_config().m_cc)
return action_result::failed(); return action_result::failed();
congruence_closure & cc = get_cc(); congruence_closure & cc = get_cc();
if (has_expr_metavar(curr_state().get_hypothesis_decl(hidx).get_type()))
return action_result::failed();
cc.add(hidx); cc.add(hidx);
// cc.display(); // cc.display();
if (cc.is_inconsistent()) { if (cc.is_inconsistent()) {

View file

@ -566,17 +566,19 @@ static bool is_logical_app(expr const & n) {
void congruence_closure::internalize_core(name const & R, expr const & e, bool toplevel, bool to_propagate) { void congruence_closure::internalize_core(name const & R, expr const & e, bool toplevel, bool to_propagate) {
lean_assert(closed(e)); lean_assert(closed(e));
if (has_expr_metavar(e)) // we allow metavariables after partitions have been frozen
if (has_expr_metavar(e) && !m_froze_partitions)
return; return;
if (m_entries.find(eqc_key(R, e))) if (m_entries.find(eqc_key(R, e)))
return; // e has already been internalized return; // e has already been internalized
update_non_eq_relations(R); update_non_eq_relations(R);
switch (e.kind()) { switch (e.kind()) {
case expr_kind::Var: case expr_kind::Meta: case expr_kind::Var:
lean_unreachable(); lean_unreachable();
case expr_kind::Sort: case expr_kind::Sort:
return; return;
case expr_kind::Constant: case expr_kind::Local: case expr_kind::Constant: case expr_kind::Local:
case expr_kind::Meta:
mk_entry_core(R, e, to_propagate, false); mk_entry_core(R, e, to_propagate, false);
return; return;
case expr_kind::Lambda: case expr_kind::Lambda: