aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tactics/setoid_replace.ml9
-rw-r--r--test-suite/bugs/closed/1322.v24
2 files changed, 29 insertions, 4 deletions
diff --git a/tactics/setoid_replace.ml b/tactics/setoid_replace.ml
index c66a55d38c..9452d4f3cd 100644
--- a/tactics/setoid_replace.ml
+++ b/tactics/setoid_replace.ml
@@ -802,15 +802,16 @@ let new_morphism m signature id hook =
try find_relation_class output'
with Not_found -> errorlabstrm "Add Morphism"
(str "Not a valid signature: " ++ pr_lconstr output' ++
- str " is neither a registered relation nor the Leibniz " ++
- str " equality.") in
+ str " is neither a registered relation nor the Leibniz " ++
+ str " equality.") in
let rel_a,rel_quantifiers_no =
match rel with
Relation rel -> rel.rel_a, rel.rel_quantifiers_no
| Leibniz (Some t) -> t, 0
- | Leibniz None -> assert false in
+ | Leibniz None -> let _,t = decompose_prod typ in t, 0 in
let rel_a_n =
- clos_norm_flags Closure.betaiotazeta empty_env Evd.empty rel_a in
+ clos_norm_flags Closure.betaiotazeta empty_env Evd.empty rel_a
+ in
try
let _,output_rel_a_n = decompose_lam_n rel_quantifiers_no rel_a_n in
let argsrev,_ = decompose_prod output_rel_a_n in
diff --git a/test-suite/bugs/closed/1322.v b/test-suite/bugs/closed/1322.v
new file mode 100644
index 0000000000..01c06f2c40
--- /dev/null
+++ b/test-suite/bugs/closed/1322.v
@@ -0,0 +1,24 @@
+Require Import Setoid.
+
+Section transition_gen.
+
+Variable I : Type.
+Variable I_eq :I -> I -> Prop.
+Variable I_eq_equiv : Setoid_Theory I I_eq.
+
+(* Add Relation I I_eq
+ reflexivity proved by I_eq_equiv.(Seq_refl I I_eq)
+ symmetry proved by I_eq_equiv.(Seq_sym I I_eq)
+ transitivity proved by I_eq_equiv.(Seq_trans I I_eq)
+as I_eq_relation. *)
+
+Add Setoid I I_eq I_eq_equiv as I_with_eq.
+
+Variable F : I -> Type.
+Variable F_morphism : forall i j, I_eq i j -> F i = F j.
+
+
+Add Morphism F with signature I_eq ==> eq as F_morphism2.
+Admitted.
+
+End transition_gen.