diff --git a/src/library/blast/discr_tree.cpp b/src/library/blast/discr_tree.cpp index 495b5e9a0..240ca62e4 100644 --- a/src/library/blast/discr_tree.cpp +++ b/src/library/blast/discr_tree.cpp @@ -171,7 +171,7 @@ auto discr_tree::insert_erase_app(node && n, bool is_root, expr const & e, buffe if (is_constant(fn) || is_local(fn)) { if (!is_root) todo.push_back(mk_pair(*g_delimiter, false)); - fun_info info = get_fun_info(fn); + fun_info info = get_fun_info(fn, args.size()); buffer pinfos; to_buffer(info.get_params_info(), pinfos); lean_assert(pinfos.size() == args.size()); @@ -281,7 +281,7 @@ bool discr_tree::find_app(node const & n, expr const & e, list> buffer args; expr const & f = get_app_args(e, args); if (is_constant(f) || is_local(f)) { - fun_info info = get_fun_info(f); + fun_info info = get_fun_info(f, args.size()); buffer pinfos; to_buffer(info.get_params_info(), pinfos); lean_assert(pinfos.size() == args.size()); diff --git a/tests/lean/run/blast_discr_tree_bug.lean b/tests/lean/run/blast_discr_tree_bug.lean new file mode 100644 index 000000000..d7a0b4116 --- /dev/null +++ b/tests/lean/run/blast_discr_tree_bug.lean @@ -0,0 +1,18 @@ +open subtype nat + +constant f : Π (a : nat), {b : nat | b > a} → nat + +definition f_flat (a : nat) (b : nat) (p : b > a) : nat := +f a (tag b p) + +definition greater [reducible] (a : nat) := {b : nat | b > a} +set_option blast.recursion.structure true + +definition f_flat_def [simp] (a : nat) (b : nat) (p : b > a) : f a (tag b p) = f_flat a b p := +rfl + +definition has_property_tag [simp] {A : Type} {p : A → Prop} (a : A) (h : p a) : has_property (tag a h) = h := +rfl + +lemma to_f_flat : ∀ (a : nat) (b : greater a), f a b = f_flat a (elt_of b) (has_property b) := +by rec_simp