aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/term.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2018-02-12 13:07:53 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2018-02-12 13:07:53 +0100
commit284869d016607fad339ea4d06bf1433c6ec23672 (patch)
tree1cae1f278186bb0aa9643fb57ca9af0eb029672f /kernel/term.ml
parent52d666a7a83e4023d9f5cd7324ed81c7f7926156 (diff)
parent42610a4659cf35e6a005d79eec273c606bdf87dd (diff)
Merge PR #1082: Fixing Print for inductive types with let-in in parameters
Diffstat (limited to 'kernel/term.ml')
-rw-r--r--kernel/term.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/term.ml b/kernel/term.ml
index fae990d45..a4c92bd33 100644
--- a/kernel/term.ml
+++ b/kernel/term.ml
@@ -352,10 +352,11 @@ let lambda_applist_assum n c l =
let rec app n subst t l =
if Int.equal n 0 then
if l == [] then substl subst t
- else anomaly (Pp.str "Not enough arguments.")
+ else anomaly (Pp.str "Too many arguments.")
else match kind_of_term t, l with
| Lambda(_,_,c), arg::l -> app (n-1) (arg::subst) c l
| LetIn(_,b,_,c), _ -> app (n-1) (substl subst b::subst) c l
+ | _, [] -> anomaly (Pp.str "Not enough arguments.")
| _ -> anomaly (Pp.str "Not enough lambda/let's.") in
app n [] c l
@@ -377,10 +378,11 @@ let prod_applist_assum n c l =
let rec app n subst t l =
if Int.equal n 0 then
if l == [] then substl subst t
- else anomaly (Pp.str "Not enough arguments.")
+ else anomaly (Pp.str "Too many arguments.")
else match kind_of_term t, l with
| Prod(_,_,c), arg::l -> app (n-1) (arg::subst) c l
| LetIn(_,b,_,c), _ -> app (n-1) (substl subst b::subst) c l
+ | _, [] -> anomaly (Pp.str "Not enough arguments.")
| _ -> anomaly (Pp.str "Not enough prod/let's.") in
app n [] c l