fix(library/congr_lemma_manager): bug in congruence lemma generator
This commit is contained in:
parent
038369533e
commit
6bbe72190d
4 changed files with 33 additions and 1 deletions
|
@ -320,7 +320,8 @@ public:
|
|||
if (std::find(result_deps.begin(), result_deps.end(), i) != result_deps.end()) {
|
||||
kinds[i] = congr_arg_kind::Fixed;
|
||||
} else if (pinfos[i].is_subsingleton()) {
|
||||
if (empty(pinfos[i].get_dependencies()))
|
||||
// See comment at mk_congr.
|
||||
if (!pinfos[i].is_prop() && pinfos[i].is_dep())
|
||||
kinds[i] = congr_arg_kind::Fixed;
|
||||
else
|
||||
kinds[i] = congr_arg_kind::Cast;
|
||||
|
|
6
tests/lean/congr_lemma_bug.lean
Normal file
6
tests/lean/congr_lemma_bug.lean
Normal file
|
@ -0,0 +1,6 @@
|
|||
constant P : Type₁
|
||||
constant P_sub : subsingleton P
|
||||
attribute P_sub [instance]
|
||||
constant q : P → Prop
|
||||
|
||||
#congr q
|
4
tests/lean/congr_lemma_bug.lean.expected.out
Normal file
4
tests/lean/congr_lemma_bug.lean.expected.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
[cast]
|
||||
λ (a a_1 : P), eq.trans (eq.refl (q a)) (congr (eq.refl q) (subsingleton.elim a a_1))
|
||||
:
|
||||
∀ (a a_1 : P), q a = q a_1
|
21
tests/lean/run/blast_congr_bug.lean
Normal file
21
tests/lean/run/blast_congr_bug.lean
Normal file
|
@ -0,0 +1,21 @@
|
|||
constant P : Type₁
|
||||
constant P_sub : subsingleton P
|
||||
attribute P_sub [instance]
|
||||
constant q : P → Prop
|
||||
|
||||
section
|
||||
set_option blast.simp true
|
||||
set_option blast.cc false
|
||||
|
||||
example (h₁ h₂ : P) : q h₁ = q h₂ :=
|
||||
by blast
|
||||
end
|
||||
|
||||
|
||||
section
|
||||
set_option blast.simp false
|
||||
set_option blast.cc true
|
||||
|
||||
example (h₁ h₂ : P) : q h₁ = q h₂ :=
|
||||
by blast
|
||||
end
|
Loading…
Reference in a new issue