;;
(* cook var term *)
-let cook curi cookingsno var =
+let cook curi cookingsno var is_letin =
let rec aux k =
let module C = Cic in
function
)
| C.Appl [] -> raise Impossible
| C.Const (uri,_) ->
- if match CicEnvironment.get_obj uri with
+ if not is_letin && match CicEnvironment.get_obj uri with
C.Definition (_,_,_,params) when mem var params -> true
| C.Definition _ -> false
| C.Axiom (_,_,params) when mem var params -> true
C.Const (uri,UriManager.relative_depth curi uri cookingsno)
| C.Abst _ as t -> t
| C.MutInd (uri,_,i) ->
- if match CicEnvironment.get_obj uri with
+ if not is_letin && match CicEnvironment.get_obj uri with
C.InductiveDefinition (_,params,_) when mem var params -> true
| C.InductiveDefinition _ -> false
| _ -> raise WrongUriToInductiveDefinition
else
C.MutInd (uri,UriManager.relative_depth curi uri cookingsno,i)
| C.MutConstruct (uri,_,i,j) ->
- if match CicEnvironment.get_obj uri with
+ if not is_letin && match CicEnvironment.get_obj uri with
C.InductiveDefinition (_,params,_) when mem var params -> true
| C.InductiveDefinition _ -> false
| _ -> raise WrongUriToInductiveDefinition
let cooked_once =
add_binder (C.Name varname) varbody vartype
(match varbody with
- Some _ -> ty
- | None -> cook curi cookingsno var ty
+ Some _ -> cook curi cookingsno var true ty
+ | None -> cook curi cookingsno var false ty
)
in
cookrec cooked_once tl