environment add_alias(parser & p, environment env, bool composite, name const & full_id, levels const & ctx_levels, buffer<expr> const & ctx_params) { name id; if (composite) id = name(name(full_id.get_prefix().get_string()), full_id.get_string()); else id = name(full_id.get_string()); if (!empty(ctx_levels) || !ctx_params.empty()) { expr r = mk_local_ref(full_id, ctx_levels, ctx_params); env = p.add_local_ref(env, id, r); } if (full_id != id) env = add_expr_alias_rec(env, id, full_id); return env; }
bool is_cases_on_recursor(environment const & env, name const & n) { return ::lean::is_aux_recursor(env, n) && strcmp(n.get_string(), "cases_on") == 0; }