)
| (k, e, ens, (C.Meta (n,l) as t), s) ->
(try
- let (_, term) = CicUtil.lookup_subst n subst in
+ let (_, term,_) = CicUtil.lookup_subst n subst in
reduce (k, e, ens,CicSubstitution.lift_meta l term,s)
with CicUtil.Subst_not_found _ ->
let t' = unwind k e ens t in
let type_t = type_of_aux' ~subst metasenv context t in
if not (R.are_convertible ~subst ~metasenv context type_t ct) then
(* debug *)
- (
- (*
- (match type_t with
- Cic.Meta (n,l) ->
- try
- let (cc, ecco) = CicUtil.lookup_subst n subst in
- prerr_endline (CicPp.ppterm ecco)
- with CicUtil.Subst_not_found _ ->
- prerr_endline "Non lo trovo"
- | _ -> ()); *)
raise (TypeCheckerFailure (sprintf
"Not well typed metavariable local context: expected a term of type %s, found %s of type %s"
- (CicPp.ppterm ct) (CicPp.ppterm t) (CicPp.ppterm type_t))))
+ (CicPp.ppterm ct) (CicPp.ppterm t) (CicPp.ppterm type_t)))
| None, _ ->
raise (TypeCheckerFailure
"Not well typed metavariable local context: an hypothesis, that is not hidden, is not instantiated")
ty
| C.Meta (n,l) ->
(try
- let (canonical_context, term) = CicUtil.lookup_subst n subst in
+ let (canonical_context,term,ty) = CicUtil.lookup_subst n subst in
check_metasenv_consistency
~subst metasenv context canonical_context l;
- type_of_aux context (CicSubstitution.lift_meta l term)
+ (* assuming subst is well typed !!!!! *)
+ CicSubstitution.lift_meta l ty
+ (* type_of_aux context (CicSubstitution.lift_meta l term) *)
with CicUtil.Subst_not_found _ ->
let (_,canonical_context,ty) = CicUtil.lookup_meta n metasenv in
- check_metasenv_consistency
- ~subst metasenv context canonical_context l;
- CicSubstitution.lift_meta l ty)
+ check_metasenv_consistency
+ ~subst metasenv context canonical_context l;
+ CicSubstitution.lift_meta l ty)
(* TASSI: CONSTRAINTS *)
| C.Sort (C.Type t) ->
let t' = CicUniv.fresh() in