@@ -76,6 +76,9 @@ let fresh env id avoid =
7676let with_context_set ctx (b , ctx' ) =
7777 (b, UnivGen. sort_context_union ctx ctx')
7878
79+ let of_context_set env ctx =
80+ UState. merge_sort_context ~sideff: false UnivRigid QGraph. Internal (UState. from_env env) ctx
81+
7982let build_dependent_inductive ind (mib ,mip ) =
8083 let realargs,_ = List. chop mip.mind_nrealdecls mip.mind_arity_ctxt in
8184 applist
@@ -230,7 +233,7 @@ let build_sym_scheme env _handle ind =
230233 mkRel 1 (* varH *) ,
231234 [|cstr (nrealargs+ 1 )|])))))
232235 in
233- c, UState. of_context_set ctx
236+ c, of_context_set env ctx
234237
235238let sym_scheme_kind =
236239 declare_individual_scheme_object " sym"
@@ -301,7 +304,7 @@ let build_sym_involutive_scheme env handle ind =
301304 NoInvert ,
302305 mkRel 1 (* varH *) ,
303306 [|mkApp(eqrefl,[|applied_ind_C;cstr (nrealargs+ 1 )|])|])))))
304- in (c, UState. of_context_set ctx)
307+ in (c, of_context_set env ctx)
305308
306309let sym_involutive_scheme_kind =
307310 declare_individual_scheme_object " sym_involutive"
@@ -461,7 +464,7 @@ let build_l2r_rew_scheme dep env handle ind kind =
461464 [|main_body|]))
462465 else
463466 main_body))))))
464- in (c, UState. of_context_set ctx)
467+ in (c, of_context_set env ctx)
465468
466469(* *********************************************************************)
467470(* Build the left-to-right rewriting lemma for hypotheses associated *)
@@ -554,7 +557,7 @@ let build_l2r_forward_rew_scheme dep env ind kind =
554557 (if dep then realsign_ind_P 1 applied_ind_P' else realsign_P 2 ) s)
555558 (mkNamedLambda (make_annot varHC sr) applied_PC'
556559 (mkVar varHC))|]))))))
557- in c, UState. of_context_set ctx
560+ in c, of_context_set env ctx
558561
559562(* *********************************************************************)
560563(* Build the right-to-left rewriting lemma for hypotheses associated *)
@@ -641,7 +644,7 @@ let build_r2l_forward_rew_scheme dep env ind kind =
641644 lift (nrealargs+ 3 ) applied_PC,
642645 mkRel 1 )|])),
643646 [|mkVar varHC|]))))))
644- in c, UState. of_context_set ctx
647+ in c, of_context_set env ctx
645648
646649(* *********************************************************************)
647650(* This function "repairs" the non-dependent r2l forward rewriting *)
@@ -859,7 +862,7 @@ let build_congr env (eq,refl,ctx) ind =
859862 [|mkApp (refl,
860863 [|mkVar varB;
861864 mkApp (mkVar varf, [|lift (mip.mind_nrealargs+ 3 ) b|])|])|])))))))
862- in c, UState. of_context_set ctx
865+ in c, of_context_set env ctx
863866
864867let congr_scheme_kind = declare_individual_scheme_object " congr"
865868 (fun env _ ind ->
0 commit comments