match CicReduction.whd context te with
C.Rel m when m > n && m <= nn -> false
| C.Rel _
- | C.Meta _
+ | C.Meta _ (* CSC: Are we sure? No recursion?*)
| C.Sort _
| C.Implicit _ -> true
| C.Cast (te,ty) ->
| (Some (n,C.Def (t,None)))::tl ->
(Some (n,C.Def ((S.lift_meta l (S.lift i t)),None)))::(aux (i+1) tl)
| None::tl -> None::(aux (i+1) tl)
- | (Some (n,C.Def (_,Some _)))::_ -> assert false
+ | (Some (n,C.Def (t,Some ty)))::tl ->
+ (Some (n,C.Def ((S.lift_meta l (S.lift i t)),Some (S.lift_meta l (S.lift i ty)))))::(aux (i+1) tl)
in
aux 1 canonical_context
in
C.Sort s2
| (C.Sort s1, C.Sort s2) -> C.Sort C.Type (*CSC manca la gestione degli universi!!! *)
| (C.Meta _, C.Sort _) -> t2'
- | (C.Meta _, C.Meta (_,[]))
- | (C.Sort _, C.Meta (_,[])) -> t2'
+ | (C.Meta _, (C.Meta (_,_) as t))
+ | (C.Sort _, (C.Meta (_,_) as t)) when CicUtil.is_closed t ->
+ t2'
| (_,_) -> raise (TypeCheckerFailure (sprintf
"Prod: expected two sorts, found = %s, %s" (CicPp.ppterm t1')
(CicPp.ppterm t2')))