aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/retyping.ml18
1 files changed, 8 insertions, 10 deletions
diff --git a/pretyping/retyping.ml b/pretyping/retyping.ml
index b01e30bac1..1a175465a3 100644
--- a/pretyping/retyping.ml
+++ b/pretyping/retyping.ml
@@ -25,18 +25,16 @@ let rec subst_type env sigma typ = function
| Prod (na,c1,c2) -> subst_type env sigma (subst1 h c2) rest
| _ -> anomaly (str "Non-functional construction")
-(* Si ft est le type d'un terme f, lequel est appliqué à args, *)
-(* [sort_of_atomic_ty] calcule ft[args] qui doit être une sorte *)
-(* On suit une méthode paresseuse, en espèrant que ft est une arité *)
-(* et sinon on substitue *)
+(* If ft is the type of f which itself is applied to args, *)
+(* [sort_of_atomic_type] computes ft[args] which has to be a sort *)
let sort_of_atomic_type env sigma ft args =
- let rec concl_of_arity env ar =
- match kind_of_term (whd_betadeltaiota env sigma ar) with
- | Prod (na, t, b) -> concl_of_arity (push_rel (na,None,t) env) b
- | Sort s -> s
- | _ -> decomp_sort env sigma (subst_type env sigma ft (Array.to_list args))
- in concl_of_arity env ft
+ let rec concl_of_arity env ar args =
+ match kind_of_term (whd_betadeltaiota env sigma ar), args with
+ | Prod (na, t, b), h::l -> concl_of_arity (push_rel (na,Some h,t) env) b l
+ | Sort s, [] -> s
+ | _ -> anomaly (str "Not a sort")
+ in concl_of_arity env ft (Array.to_list args)
let type_of_var env id =
try let (_,_,ty) = lookup_named id env in ty