- let typ,_ =
- match terms with
- [] -> assert false
- | he::tl ->
- (* We need to check that all the convertibility of all the terms *)
- let u = List.fold_left ( (* TASSI: FIXME *)
- fun u t ->
- let b,u1 = CicReduction.are_convertible context he t u in
- if not b then
- raise AllSelectedTermsMustBeConvertible
- else
- u1) CicUniv.empty_ugraph tl in
- (CicTypeChecker.type_of_aux' metasenv context he u)
+ let terms =
+ let path =
+ match concl_pat with
+ None -> Cic.Implicit (Some `Hole)
+ | Some path -> path in
+ let roots = CicUtil.select ~term:ty ~context:path in
+ List.fold_left
+ (fun acc (i, r) ->
+ ProofEngineHelpers.find_subterms
+ ~eq:ProofEngineReduction.alpha_equivalence ~wanted:term r @ acc
+ ) [] roots
+ in
+ let typ =
+ let typ,u =
+ CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph in
+ (* We need to check that all the convertibility of all the terms *)
+ ignore (
+ (* TASSI: FIXME *)
+ List.fold_left
+ (fun u t ->
+ let b,u1 = CicReduction.are_convertible context term t u in
+ if not b then
+ raise AllSelectedTermsMustBeConvertible
+ else
+ u1
+ ) u terms) ;
+ typ