mirror of
https://github.com/Z3Prover/z3
synced 2026-06-11 03:15:36 +00:00
disable test in tptp, move to native lambdas
This commit is contained in:
parent
3e0a350411
commit
eaf7562a1d
24 changed files with 54 additions and 222 deletions
|
|
@ -240,7 +240,6 @@ namespace euf {
|
|||
else
|
||||
break;
|
||||
}
|
||||
r = unfold_lambda_def(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -254,34 +253,6 @@ namespace euf {
|
|||
}
|
||||
}
|
||||
|
||||
// We assume that m_rewriter should produce
|
||||
// something amounting to weak-head normal form WHNF
|
||||
|
||||
// Unfold a lambda-def application f(args) to the corresponding lambda expression.
|
||||
// For a func_decl f with arity n and lambda-def quantifier (lambda (x1..xk) body),
|
||||
// f(a1,...,an) is unfolded to (lambda (x1..xk) body[params := a1..an]).
|
||||
// For a constant f (arity 0) that is a lambda-def, returns the lambda directly.
|
||||
expr_ref ho_matcher::unfold_lambda_def(expr* e) const {
|
||||
if (!is_app(e))
|
||||
return expr_ref(e, m);
|
||||
app* a = to_app(e);
|
||||
func_decl* f = a->get_decl();
|
||||
quantifier* lam = m.is_lambda_def(f);
|
||||
if (!lam)
|
||||
return expr_ref(e, m);
|
||||
|
||||
unsigned arity = f->get_arity();
|
||||
SASSERT(is_lambda(lam));
|
||||
|
||||
if (arity == 0)
|
||||
// Constant lambda-def: just return the lambda expression
|
||||
return expr_ref(lam, m);
|
||||
|
||||
var_subst subst(m, false);
|
||||
expr_ref r = subst(lam, to_app(e)->get_num_args(), to_app(e)->get_args());
|
||||
return r;
|
||||
}
|
||||
|
||||
void ho_matcher::reduce(match_goal& wi) {
|
||||
wi.pat = whnf_star(wi.pat, wi.pat_offset());
|
||||
wi.t = whnf_star(wi.t, wi.term_offset());
|
||||
|
|
@ -684,7 +655,7 @@ namespace euf {
|
|||
}
|
||||
auto is_ho = any_of(subterms::all(expr_ref(p, m)), [&](expr* t) {
|
||||
return m_unitary.is_flex(0, t) ||
|
||||
m.is_lambda_def(t) ||
|
||||
// m.is_lambda_def(t) ||
|
||||
is_lambda(t);
|
||||
});
|
||||
if (!is_ho)
|
||||
|
|
@ -703,7 +674,8 @@ namespace euf {
|
|||
todo.pop_back();
|
||||
continue;
|
||||
}
|
||||
if ((m_unitary.is_flex(0, t) && lvl > 1) || m.is_lambda_def(t) || is_lambda(t)) {
|
||||
if ((m_unitary.is_flex(0, t) && lvl > 1) || // m.is_lambda_def(t) ||
|
||||
is_lambda(t)) {
|
||||
if (!contains_pat2abs)
|
||||
m_pat2abs.insert_if_not_there(p, svector<std::pair<unsigned, expr*>>()).push_back({ nb, t });
|
||||
auto v = m.mk_var(nb++, t->get_sort());
|
||||
|
|
|
|||
|
|
@ -355,8 +355,6 @@ namespace euf {
|
|||
|
||||
void reduce(match_goal& wi);
|
||||
|
||||
expr_ref unfold_lambda_def(expr* e) const;
|
||||
|
||||
trail_stack& trail() { return m_trail; }
|
||||
|
||||
std::ostream& display(std::ostream& out) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue