@@ -191,17 +191,17 @@ let build_functional_principle env (sigma : Evd.evar_map) old_princ_type sorts f
191191 (Induction. compute_elim_sig sigma (EConstr. of_constr old_princ_type))
192192 .Induction. nparams
193193 in
194+ let funs = Array. map EConstr. mkConstU funs in
194195 let new_principle_type =
195196 Functional_principles_types. compute_new_princ_type_from_rel (Global. env () )
196- (Array. map Constr. mkConstU funs)
197+ (Array. map ( EConstr. to_constr sigma) funs)
197198 (Array. map (fun s -> EConstr.ESorts. kind sigma s) sorts) old_princ_type
198199 in
199200 let sigma, _ =
200201 Typing. type_of ~refresh: true env sigma
201202 (EConstr. of_constr new_principle_type)
202203 in
203- let map (c , u ) = EConstr. mkConstU (c, EConstr.EInstance. make u) in
204- let ftac = proof_tac (Array. map map funs) mutr_nparams in
204+ let ftac = proof_tac funs mutr_nparams in
205205 let uctx = Evd. ustate sigma in
206206 let typ = EConstr. of_constr new_principle_type in
207207 let body, typ, univs, _safe, _uctx =
@@ -364,7 +364,7 @@ let generate_principle (evd : Evd.evar_map ref) pconstants on_error is_general
364364 evd := sigma;
365365 let princ_type = EConstr.Unsafe. to_constr princ_type in
366366 generate_functional_principle evd princ_type None None
367- (Array. of_list pconstants) (* funs_kn *)
367+ (Array. map_of_list ( fun ( c , u ) -> c, EConstr.EInstance. make u ) pconstants) (* funs_kn *)
368368 i
369369 (continue_proof 0 [|funs_kn.(i)|]))
370370 0 fix_rec_l
@@ -1274,7 +1274,7 @@ let get_funs_constant mp =
12741274 in
12751275 l_const
12761276
1277- let make_scheme evd (fas : (Constr.pconstant * UnivGen.QualityOrSet.t) list ) : _ list =
1277+ let make_scheme evd (fas : (Constant.t EConstr.puniverses * UnivGen.QualityOrSet.t) list ) : _ list =
12781278 let exception Found_type of int in
12791279 let env = Global. env () in
12801280 let funs = List. map fst fas in
@@ -1300,7 +1300,7 @@ let make_scheme evd (fas : (Constr.pconstant * UnivGen.QualityOrSet.t) list) : _
13001300 List. map
13011301 (fun idx ->
13021302 let ind = (first_fun_kn, idx) in
1303- ((ind, EConstr.EInstance. make @@ snd first_fun), true , EConstr.ESorts. prop))
1303+ ((ind, snd first_fun), true , EConstr.ESorts. prop))
13041304 funs_indexes
13051305 in
13061306 let sigma, schemes = Indrec. build_mutual_induction_scheme env ! evd ind_list in
@@ -1354,7 +1354,7 @@ let make_scheme evd (fas : (Constr.pconstant * UnivGen.QualityOrSet.t) list) : _
13541354 if List. is_empty other_princ_types then [(body, typ, univs, opaque)]
13551355 else
13561356 let other_fun_princ_types =
1357- let funs = Array. map Constr. mkConstU this_block_funs in
1357+ let funs = Array. map EConstr. ( mkConstU %> to_constr sigma) this_block_funs in
13581358 let sorts = Array. of_list sorts in
13591359 let sorts = Array. map (fun s -> EConstr.ESorts. kind sigma s) sorts in
13601360 List. map
@@ -1418,14 +1418,13 @@ let make_scheme evd (fas : (Constr.pconstant * UnivGen.QualityOrSet.t) list) : _
14181418 lemmas for each function in [funs] w.r.t. [graphs]
14191419*)
14201420
1421- let derive_correctness (funs : Constr.pconstant list ) (graphs : inductive list )
1421+ let derive_correctness (funs : Constant.t EConstr.puniverses list ) (graphs : inductive list )
14221422 =
14231423 let open EConstr in
14241424 assert (funs <> [] );
14251425 assert (graphs <> [] );
14261426 let funs = Array. of_list funs and graphs = Array. of_list graphs in
1427- let map (c , u ) = mkConstU (c, EInstance. make u) in
1428- let funs_constr = Array. map map funs in
1427+ let funs_constr = Array. map mkConstU funs in
14291428 (* XXX STATE Why do we need this... why is the toplevel protection not enough *)
14301429 funind_purify
14311430 (fun () ->
@@ -1595,8 +1594,7 @@ let derive_inversion env fix_names =
15951594 Evd. fresh_global env evd
15961595 (Option. get (Constrintern. locate_reference (Libnames. qualid_of_ident id)))
15971596 in
1598- let cst, u = EConstr. destConst evd c in
1599- (evd, (cst, EConstr.EInstance. kind evd u) :: l))
1597+ (evd, EConstr. destConst evd c :: l))
16001598 fix_names (evd', [] )
16011599 in
16021600 (*
@@ -2154,7 +2152,7 @@ let build_scheme fas =
21542152 ++ spc ()
21552153 ++ str " should be the named of a globally defined function" )
21562154 in
2157- ((c, EConstr.EInstance. kind ! evd u), sort))
2155+ ((c, u), sort))
21582156 fas
21592157 in
21602158 let bodies_types = make_scheme evd pconstants in
0 commit comments