(* only to check that ty is well-typed *)
let _ = type_of ty in ()
| C.CurrentProof (_,conjs,te,ty,_) ->
- (*CSC: bisogna controllare anche il metasenv!!! *)
- let _ = type_of_aux' conjs [] ty in
- if not (R.are_convertible [] (type_of_aux' conjs [] te) ty)
- then
- raise (NotWellTyped ("CurrentProof" ^ (U.string_of_uri uri)))
+ let _ =
+ List.fold_left
+ (fun metasenv ((_,context,ty) as conj) ->
+ ignore (type_of_aux' metasenv context ty) ;
+ metasenv @ [conj]
+ ) [] conjs
+ in
+ let _ = type_of_aux' conjs [] ty in
+ if not (R.are_convertible [] (type_of_aux' conjs [] te) ty)
+ then
+ raise (NotWellTyped ("CurrentProof" ^ (U.string_of_uri uri)))
| _ -> raise (WrongUriToConstant (U.string_of_uri uri))
) ;
CicEnvironment.set_type_checking_info uri ;
let cl' =
List.map
(fun (id,ty) ->
- (id, ty, snd (split_prods tys paramsno ty))) cl
+ (id, snd (split_prods tys paramsno ty))) cl
in
(tys,List.length tl,isinductive,paramsno,cl')
| _ ->
pl true
else
List.fold_right
- (fun (p,(_,te,c)) i ->
+ (fun (p,(_,c)) i ->
let rl' =
- let debrujinedte = debrujin_constructor uri len te in
+ let debrujinedte = debrujin_constructor uri len c in
recursive_args tys 0 len debrujinedte
in
let (e,safes',n',nn',x',context') =
let cl' =
List.map
(fun (id,ty) ->
- (id, ty, snd (split_prods tys paramsno ty))) cl
+ (id, snd (split_prods tys paramsno ty))) cl
in
(tys,List.length tl,isinductive,paramsno,cl')
| _ ->
(*CSC: supponiamo come prima che nessun controllo sia necessario*)
(*CSC: sugli argomenti di una applicazione *)
List.fold_right
- (fun (p,(_,te,c)) i ->
+ (fun (p,(_,c)) i ->
let rl' =
- let debrujinedte = debrujin_constructor uri len te in
+ let debrujinedte = debrujin_constructor uri len c in
recursive_args tys 0 len debrujinedte
in
let (e, safes',n',nn',x',context') =
let cl' =
List.map
(fun (id,ty) ->
- (id, ty, snd (split_prods tys paramsno ty))) cl
+ (id, snd (split_prods tys paramsno ty))) cl
in
(tys,List.length tl,isinductive,paramsno,cl')
| _ ->
guarded_by_destructors context n nn kl x safes outtype &&
(*CSC: manca ??? il controllo sul tipo di term? *)
List.fold_right
- (fun (p,(_,te,c)) i ->
+ (fun (p,(_,c)) i ->
let rl' =
- let debrujinedte = debrujin_constructor uri len te in
+ let debrujinedte = debrujin_constructor uri len c in
recursive_args tys 0 len debrujinedte
in
let (e,safes',n',nn',x',context') =
let cl' =
List.map
(fun (id,ty) ->
- (id, ty, snd (split_prods tys paramsno ty))) cl
+ (id, snd (split_prods tys paramsno ty))) cl
in
(tys,List.length tl,isinductive,paramsno,cl')
| _ ->
i && guarded_by_destructors context n nn kl x safes t)
tl true &&
List.fold_right
- (fun (p,(_,te,c)) i ->
+ (fun (p,(_,c)) i ->
let rl' =
- let debrujinedte = debrujin_constructor uri len te in
+ let debrujinedte = debrujin_constructor uri len c in
recursive_args tys 0 len debrujinedte
in
let (e, safes',n',nn',x',context') =