(* *)
(*****************************************************************************)
-let universes_of_obj t =
+(* uri is the uri of the actual object that must be 'skipped' *)
+let universes_of_obj uri t =
+ let eq = UriManager.eq in
let don = ref [] in
let module C = Cic in
let rec aux t =
aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
CicUniv.empty_ugraph))
| C.MutInd (u,_,exp_named_subst) ->
- if List.mem u !don then
+ if List.mem u !don || eq u uri then
[]
else
begin
don := u::!don;
(match fst(CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph) with
+ CicUniv.empty_ugraph)
+ with
| C.InductiveDefinition (l,_,_) ->
List.fold_left (
fun y (_,_,t,l') ->
List.fold_left (fun x (uri,t) -> x @ (aux t) ) [] exp_named_subst
end
| C.MutConstruct (u,_,_,exp_named_subst) ->
- if List.mem u !don then
+ if List.mem u !don || eq u uri then
[]
else
begin
C.Constant (_,Some te,ty,v) -> aux te @ aux ty @
List.fold_left (
fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v
| C.Constant (_,None,ty,v) -> aux ty @
List.fold_left (
fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v
| C.CurrentProof (_,conjs,te,ty,v) -> aux te @ aux ty @
List.fold_left (
fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v
| C.Variable (_,Some bo,ty,v) -> aux bo @ aux ty @
List.fold_left (
fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v
| C.Variable (_,None ,ty,v) -> aux ty @
List.fold_left (
fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v
| C.InductiveDefinition (l,v,_) ->
(List.fold_left (
[] l) @
(List.fold_left
(fun l u ->
- l @ aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
- CicUniv.empty_ugraph))
+ l @ if eq u uri then [] else
+ (aux_obj (CicEnvironment.get_obj ~not_jet_cooked:true u
+ CicUniv.empty_ugraph)))
[] v)
)
in
aux_obj (t,CicUniv.empty_ugraph)
let clean_and_fill uri obj ugraph =
- let list_of_universes = universes_of_obj obj in
+ let list_of_universes = universes_of_obj uri obj in
let ugraph = CicUniv.clean_ugraph ugraph list_of_universes in
let ugraph = CicUniv.fill_empty_nodes_with_uri ugraph uri in
ugraph