feat(library/app_builder): avoid redundant proof terms at mk_of_iff_true and mk_not_of_iff_false

This commit is contained in:
Leonardo de Moura 2015-11-22 15:49:17 -08:00
parent 94f7b7f95d
commit fc461ce832
2 changed files with 14 additions and 0 deletions

View file

@ -500,11 +500,19 @@ struct app_builder::imp {
}
expr mk_not_of_iff_false(expr const & H) {
if (is_constant(get_app_fn(H), get_iff_false_intro_name())) {
// not_of_iff_false (iff_false_intro H) == H
return app_arg(H);
}
// TODO(Leo): implement custom version if bottleneck.
return mk_app(get_not_of_iff_false_name(), {H});
}
expr mk_of_iff_true(expr const & H) {
if (is_constant(get_app_fn(H), get_iff_true_intro_name())) {
// of_iff_true (iff_true_intro H) == H
return app_arg(H);
}
// TODO(Leo): implement custom version if bottleneck.
return mk_app(get_of_iff_true_name(), {H});
}

View file

@ -1,5 +1,6 @@
set_option blast.subst false
set_option blast.simp false
set_option pp.all true
definition foo1 (a b : nat) (p : Prop) : a = b → (b = a → p) → p :=
by blast
@ -10,3 +11,8 @@ definition foo2 (a b c : nat) (p : Prop) : a = b → b = c → (c = a → p) →
by blast
print foo2
definition foo3 (a b c d : nat) (p : Prop) : a ≠ d → (d ≠ a → p) → p :=
by blast
print foo3