let term = CicUtil.term_of_uri uri in
let ty,_ = CicTypeChecker.type_of_aux' [] [] term CicUniv.oblivion_ugraph in
let tkeys = Universe.keys [] ty in
- let index_cmd =
- List.map
- (fun key -> GrafiteAst.Index(HExtlib.dummy_floc,(Some key),uri))
- tkeys
+ let universe = automation_cache.AutomationCache.univ in
+ let universe, index_cmd =
+ List.fold_left
+ (fun (universe,acc) key ->
+ let cands = Universe.get_candidates universe key in
+ let tys =
+ List.map
+ (fun t ->
+ let ty, _ =
+ CicTypeChecker.type_of_aux' [] [] t CicUniv.oblivion_ugraph
+ in
+ ty)
+ cands
+ in
+ if List.for_all
+ (fun cty ->
+ not (fst(CicReduction.are_convertible [] ty cty
+ CicUniv.oblivion_ugraph))) tys
+ then
+ Universe.index universe key term,
+ GrafiteAst.Index(HExtlib.dummy_floc,(Some key),uri)::acc
+ else
+ universe, acc)
+ (universe,[]) tkeys
in
let is_equational = is_equational_fact ty in
let select_cmd =
else
[]
in
- let universe = automation_cache.AutomationCache.univ in
- let universe = Universe.index_term_and_unfolded_term universe [] term ty in
let automation_cache =
if is_equational then
AutomationCache.add_term_to_active automation_cache [] [] [] term None