@@ -238,7 +238,7 @@ let empty =
238238 initial_universes = UGraph. initial_universes;
239239 minim_extra = UnivMinim. empty_extra; }
240240
241- let make ~ lbound univs =
241+ let make univs =
242242 { empty with
243243 universes = univs;
244244 initial_universes = univs }
@@ -313,7 +313,7 @@ let union uctx uctx' =
313313 let newus = Level.Set. diff newus (UnivFlex. domain uctx.univ_variables) in
314314 let extra = UnivMinim. extra_union uctx.minim_extra uctx'.minim_extra in
315315 let declarenew g =
316- Level.Set. fold (fun u g -> UGraph. add_universe u ~lbound: UGraph.Bound. Set ~ strict:false g) newus g
316+ Level.Set. fold (fun u g -> UGraph. add_universe u ~strict: false g) newus g
317317 in
318318 let fail_union s q1 q2 =
319319 if UGraph. type_in_type uctx.universes then s
@@ -944,33 +944,30 @@ let check_univ_decl ~poly uctx decl =
944944 else Monomorphic_entry (check_mono_univ_decl uctx decl) in
945945 entry, binders
946946
947- let is_bound l lbound = match lbound with
948- | UGraph.Bound. Prop -> false
949- | UGraph.Bound. Set -> Level. is_set l
950-
951- let restrict_universe_context ?(lbound = UGraph.Bound. Set ) (univs , csts ) keep =
947+ let restrict_universe_context (univs , csts ) keep =
952948 let removed = Level.Set. diff univs keep in
953949 if Level.Set. is_empty removed then univs, csts
954950 else
955951 let allunivs = Constraints. fold (fun (u ,_ ,v ) all -> Level.Set. add u (Level.Set. add v all)) csts univs in
956952 let g = UGraph. initial_universes in
957- let g = Level.Set. fold (fun v g -> if Level. is_set v then g else
958- UGraph. add_universe v ~lbound ~strict: false g) allunivs g in
953+ let g = Level.Set. fold (fun v g ->
954+ if Level. is_set v then g else
955+ UGraph. add_universe v ~strict: false g) allunivs g in
959956 let g = UGraph. merge_constraints csts g in
960957 let allkept = Level.Set. union (UGraph. domain UGraph. initial_universes) (Level.Set. diff allunivs removed) in
961958 let csts = UGraph. constraints_for ~kept: allkept g in
962- let csts = Constraints. filter (fun (l ,d ,r ) -> not (is_bound l lbound && d == Le )) csts in
959+ let csts = Constraints. filter (fun (l ,d ,r ) -> not (Level. is_set l && d == Le )) csts in
963960 (Level.Set. inter univs keep, csts)
964961
965- let restrict ? lbound uctx vars =
962+ let restrict uctx vars =
966963 let vars = Id.Map. fold (fun na l vars -> Level.Set. add l vars)
967964 (snd (fst uctx.names)) vars
968965 in
969- let uctx' = restrict_universe_context ?lbound uctx.local vars in
966+ let uctx' = restrict_universe_context uctx.local vars in
970967 { uctx with local = uctx' }
971968
972- let restrict_even_binders ? lbound uctx vars =
973- let uctx' = restrict_universe_context ?lbound uctx.local vars in
969+ let restrict_even_binders uctx vars =
970+ let uctx' = restrict_universe_context uctx.local vars in
974971 { uctx with local = uctx' }
975972
976973let restrict_constraints uctx csts =
@@ -994,7 +991,7 @@ let merge ?loc ~sideff rigid uctx uctx' =
994991 let local = ContextSet. append uctx' uctx.local in
995992 let declare g =
996993 Level.Set. fold (fun u g ->
997- try UGraph. add_universe ~lbound: UGraph.Bound. Set ~ strict:false u g
994+ try UGraph. add_universe ~strict: false u g
998995 with UGraph. AlreadyDeclared when sideff -> g)
999996 levels g
1000997 in
@@ -1055,7 +1052,7 @@ let demote_global_univs (lvl_set,csts_set) uctx =
10551052 let univ_variables = Level.Set. fold UnivFlex. remove lvl_set uctx.univ_variables in
10561053 let update_ugraph g =
10571054 let g = Level.Set. fold (fun u g ->
1058- try UGraph. add_universe u ~lbound: Set ~ strict:true g
1055+ try UGraph. add_universe u ~strict: true g
10591056 with UGraph. AlreadyDeclared -> g)
10601057 lvl_set
10611058 g
@@ -1080,7 +1077,7 @@ let merge_seff uctx uctx' =
10801077 let levels = ContextSet. levels uctx' in
10811078 let declare g =
10821079 Level.Set. fold (fun u g ->
1083- try UGraph. add_universe ~lbound: UGraph.Bound. Set ~ strict:false u g
1080+ try UGraph. add_universe ~strict: false u g
10841081 with UGraph. AlreadyDeclared -> g)
10851082 levels g
10861083 in
@@ -1122,9 +1119,8 @@ let add_loc l loc (names, (qnames_rev,unames_rev) as orig) =
11221119 | Some _ -> (names, (qnames_rev, Level.Map. add l { uname = None ; uloc = loc } unames_rev))
11231120
11241121let add_universe ?loc name strict uctx u =
1125- let lbound = UGraph.Bound. Set in
1126- let initial_universes = UGraph. add_universe ~lbound ~strict u uctx.initial_universes in
1127- let universes = UGraph. add_universe ~lbound ~strict u uctx.universes in
1122+ let initial_universes = UGraph. add_universe ~strict u uctx.initial_universes in
1123+ let universes = UGraph. add_universe ~strict u uctx.universes in
11281124 let local = ContextSet. add_universe u uctx.local in
11291125 let names =
11301126 match name with
@@ -1159,15 +1155,15 @@ let new_univ_variable ?loc rigid name uctx =
11591155
11601156let add_forgotten_univ uctx u = add_universe None true uctx u
11611157
1162- let make_with_initial_binders ~ lbound univs binders =
1163- let uctx = make ~lbound univs in
1158+ let make_with_initial_binders univs binders =
1159+ let uctx = make univs in
11641160 List. fold_left
11651161 (fun uctx { CAst. loc; v = id } ->
11661162 fst (new_univ_variable ?loc univ_rigid (Some id) uctx))
11671163 uctx binders
11681164
11691165let from_env ?(binders =[] ) env =
1170- make_with_initial_binders ~lbound: UGraph.Bound. Set (Environ. universes env) binders
1166+ make_with_initial_binders (Environ. universes env) binders
11711167
11721168let make_nonalgebraic_variable uctx u =
11731169 { uctx with univ_variables = UnivFlex. make_nonalgebraic_variable uctx.univ_variables u }
@@ -1198,10 +1194,10 @@ let collapse_above_prop_sort_variables ~to_prop uctx =
11981194let collapse_sort_variables uctx =
11991195 { uctx with sort_variables = QState. collapse uctx.sort_variables }
12001196
1201- let minimize ?( lbound = UGraph.Bound. Set ) uctx =
1197+ let minimize uctx =
12021198 let open UnivMinim in
12031199 let (vars', us') =
1204- normalize_context_set ~lbound uctx.universes uctx.local uctx.univ_variables
1200+ normalize_context_set uctx.universes uctx.local uctx.univ_variables
12051201 uctx.minim_extra
12061202 in
12071203 if ContextSet. equal us' uctx.local then uctx
0 commit comments