(* 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
| C.Appl l ->
List.fold_right (fun x i -> i && does_not_occur context n nn x) l true
| C.Const _
- | C.Abst _
| C.MutInd _
| C.MutConstruct _ -> true
| C.MutCase (_,_,_,out,te,pl) ->
| C.Lambda _
| C.LetIn _ -> raise (Impossible 4) (* due to type-checking *)
| C.Appl _ -> []
- | C.Const _
- | C.Abst _ -> raise (Impossible 5)
+ | C.Const _ -> raise (Impossible 5)
| C.MutInd _
| C.MutConstruct _
| C.MutCase _
check_is_really_smaller_arg context n nn kl x safes he
| C.Appl [] -> raise (Impossible 11)
| C.Const _
- | C.Abst _
| C.MutInd _ -> raise (Impossible 12)
| C.MutConstruct _ -> false
| C.MutCase (uri,_,i,outtype,term,pl) ->
(fun t i -> i && guarded_by_destructors context n nn kl x safes t)
tl true
| C.Const _
- | C.Abst _
| C.MutInd _
| C.MutConstruct _ -> true
| C.MutCase (uri,_,i,outtype,term,pl) ->
guarded_by_constructors context n nn true te tl coInductiveTypeURI
| C.Appl _ ->
does_not_occur context n nn te
- | C.Const _
- | C.Abst _ -> raise (Impossible 26)
+ | C.Const _ -> raise (Impossible 26)
| C.MutInd (uri,_,_) when uri == coInductiveTypeURI ->
guarded_by_constructors context n nn true te [] coInductiveTypeURI
| C.MutInd _ ->
| C.Appl _ ->
List.fold_left
(fun i x -> i && does_not_occur context n nn x) true l
- | C.Const _
- | C.Abst _ -> raise (Impossible 31)
+ | C.Const _ -> raise (Impossible 31)
| C.MutInd _ ->
List.fold_left
(fun i x -> i && does_not_occur context n nn x) true l
| C.Appl l ->
List.fold_right (fun x i -> i && does_not_occur context n nn x) l true
| C.Const _ -> true
- | C.Abst _
| C.MutInd _ -> assert false
| C.MutConstruct _ -> true
| C.MutCase (_,_,_,out,te,pl) ->
else
C.Appl (outtype::arguments@(if need_dummy then [] else [term]))
| C.Prod (name,so,de) ->
- C.Prod (C.Anonimous,so,type_of_branch
- ((Some (name,(C.Decl so)))::context) argsno need_dummy
- (CicSubstitution.lift 1 outtype)
- (C.Appl [CicSubstitution.lift 1 term ; C.Rel 1]) de)
+ let term' =
+ match CicSubstitution.lift 1 term with
+ C.Appl l -> C.Appl (l@[C.Rel 1])
+ | t -> C.Appl [t ; C.Rel 1]
+ in
+ C.Prod (C.Anonimous,so,type_of_branch
+ ((Some (name,(C.Decl so)))::context) argsno need_dummy
+ (CicSubstitution.lift 1 outtype) term' de)
| _ -> raise (Impossible 20)
(* check_metasenv_consistency checks that the "canonical" context of a
let cty = cooked_type_of_constant uri cookingsno in
decr fdebug ;
cty
- | C.Abst _ -> raise (Impossible 22)
| C.MutInd (uri,cookingsno,i) ->
incr fdebug ;
let cty = cooked_type_of_mutual_inductive_defs uri cookingsno i in
(* only to check that ty is well-typed *)
let _ = type_of ty in ()
| C.CurrentProof (_,conjs,te,ty) ->
- (*CSC [] wrong *)
+ (*CSC: bisogna controllare anche il metasenv!!! *)
let _ = type_of_aux' conjs [] ty in
debug (type_of_aux' conjs [] te) [] ;
if not (R.are_convertible [] (type_of_aux' conjs [] te) ty) then