aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/bugs/closed/4280.v
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-07-28 17:32:30 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-07-28 17:32:30 +0200
commit524bff66f40908dc3d17b6a18ee4253a2e61093e (patch)
tree17b442df07fa622dc2a600e278d6844262276ab3 /test-suite/bugs/closed/4280.v
parent0621891c4ba7606d91e614408378af17d3b0aee3 (diff)
Adding a test for bug #4280.
Diffstat (limited to 'test-suite/bugs/closed/4280.v')
-rw-r--r--test-suite/bugs/closed/4280.v24
1 files changed, 24 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/4280.v b/test-suite/bugs/closed/4280.v
new file mode 100644
index 000000000..fd7897509
--- /dev/null
+++ b/test-suite/bugs/closed/4280.v
@@ -0,0 +1,24 @@
+Require Import ZArith.
+Require Import Eqdep_dec.
+Local Open Scope Z_scope.
+
+Definition t := { n: Z | n > 1 }.
+
+Program Definition two : t := 2.
+Next Obligation. omega. Qed.
+
+Program Definition t_eq (x y: t) : {x=y} + {x<>y} :=
+ if Z.eq_dec (proj1_sig x) (proj1_sig y) then left _ else right _.
+Next Obligation.
+ destruct x as [x Px], y as [y Py]. simpl in H; subst y.
+ f_equal. apply UIP_dec. decide equality.
+Qed.
+Next Obligation.
+ congruence.
+Qed.
+
+Definition t_list_eq: forall (x y: list t), {x=y} + {x<>y}.
+Proof. decide equality. apply t_eq. Defined.
+
+Goal match t_list_eq (two::nil) (two::nil) with left _ => True | right _ => False end.
+Proof. exact I. Qed.