aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2018-06-21 10:36:17 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2018-06-21 10:38:09 +0200
commitb098de535db3a17777fb77733229bbbfb914511f (patch)
tree666b53186a7bcdd31f346eb13cff210e2596b1d4
parent3d4899f841adc7cb0c1cec7c49ae3366dda3b217 (diff)
Fix #5719: Uncaught exception Invalid_argument.
It seems that lifting a term with a negative index is not equivalent to strengthening it by applying to a dummy substitution. This looks suspicious at best.
-rw-r--r--pretyping/cases.ml3
-rw-r--r--test-suite/bugs/closed/5719.v9
2 files changed, 11 insertions, 1 deletions
diff --git a/pretyping/cases.ml b/pretyping/cases.ml
index 93ca9dc5e..2d72b9db6 100644
--- a/pretyping/cases.ml
+++ b/pretyping/cases.ml
@@ -1699,7 +1699,8 @@ let abstract_tycon ?loc env evdref subst tycon extenv t =
let ty = get_type_of env !evdref t in
Evarutil.evd_comb1 (refresh_universes (Some false) env) evdref ty
in
- let ty = lift (-k) (aux x ty) in
+ let dummy_subst = List.init k (fun _ -> mkProp) in
+ let ty = substl dummy_subst (aux x ty) in
let depvl = free_rels !evdref ty in
let inst =
List.map_i
diff --git a/test-suite/bugs/closed/5719.v b/test-suite/bugs/closed/5719.v
new file mode 100644
index 000000000..0fad5f54e
--- /dev/null
+++ b/test-suite/bugs/closed/5719.v
@@ -0,0 +1,9 @@
+Axiom cons_data_one :
+ forall (Aone : unit -> Set) (i : unit) (a : Aone i), nat.
+Axiom P : nat -> Prop.
+Axiom children_data_rect3 : forall {Aone : unit -> Set}
+ (cons_one_case : forall (i : unit) (b : Aone i),
+ nat -> nat -> P (cons_data_one Aone i b)),
+ P 0.
+Fail Definition decide_children_equality IH := children_data_rect3
+ (fun _ '(existT _ _ _) => match IH with tt => _ end).