@@ -319,9 +319,6 @@ let fresh_instance_from ctx inst =
319
319
let constraints = AUContext. instantiate inst ctx in
320
320
inst, (ctx', constraints)
321
321
322
- let unsafe_instance_from ctx =
323
- (Univ.AUContext. instance ctx, Univ. instantiate_univ_context ctx)
324
-
325
322
(* * Fresh universe polymorphic construction *)
326
323
327
324
let fresh_constant_instance env c inst =
@@ -358,34 +355,6 @@ let fresh_constructor_instance env (ind,i) inst =
358
355
let inst, ctx = fresh_instance_from (ACumulativityInfo. univ_context acumi) inst in
359
356
(((ind,i),inst), ctx)
360
357
361
- let unsafe_constant_instance env c =
362
- let cb = lookup_constant c env in
363
- match cb.Declarations. const_universes with
364
- | Declarations. Monomorphic_const _ ->
365
- ((c,Instance. empty), UContext. empty)
366
- | Declarations. Polymorphic_const auctx ->
367
- let inst, ctx = unsafe_instance_from auctx in ((c, inst), ctx)
368
-
369
- let unsafe_inductive_instance env ind =
370
- let mib, mip = Inductive. lookup_mind_specif env ind in
371
- match mib.Declarations. mind_universes with
372
- | Declarations. Monomorphic_ind _ -> ((ind,Instance. empty), UContext. empty)
373
- | Declarations. Polymorphic_ind auctx ->
374
- let inst, ctx = unsafe_instance_from auctx in ((ind,inst), ctx)
375
- | Declarations. Cumulative_ind acumi ->
376
- let inst, ctx = unsafe_instance_from (ACumulativityInfo. univ_context acumi) in
377
- ((ind,inst), ctx)
378
-
379
- let unsafe_constructor_instance env (ind ,i ) =
380
- let mib, mip = Inductive. lookup_mind_specif env ind in
381
- match mib.Declarations. mind_universes with
382
- | Declarations. Monomorphic_ind _ -> (((ind, i),Instance. empty), UContext. empty)
383
- | Declarations. Polymorphic_ind auctx ->
384
- let inst, ctx = unsafe_instance_from auctx in (((ind, i),inst), ctx)
385
- | Declarations. Cumulative_ind acumi ->
386
- let inst, ctx = unsafe_instance_from (ACumulativityInfo. univ_context acumi) in
387
- (((ind, i),inst), ctx)
388
-
389
358
open Globnames
390
359
391
360
let fresh_global_instance ?names env gr =
@@ -410,19 +379,6 @@ let fresh_inductive_instance env sp =
410
379
let fresh_constructor_instance env sp =
411
380
fresh_constructor_instance env sp None
412
381
413
- let unsafe_global_instance env gr =
414
- match gr with
415
- | VarRef id -> mkVar id, UContext. empty
416
- | ConstRef sp ->
417
- let c, ctx = unsafe_constant_instance env sp in
418
- mkConstU c, ctx
419
- | ConstructRef sp ->
420
- let c, ctx = unsafe_constructor_instance env sp in
421
- mkConstructU c, ctx
422
- | IndRef sp ->
423
- let c, ctx = unsafe_inductive_instance env sp in
424
- mkIndU c, ctx
425
-
426
382
let constr_of_global gr =
427
383
let c, ctx = fresh_global_instance (Global. env () ) gr in
428
384
if not (Univ.ContextSet. is_empty ctx) then
@@ -437,9 +393,6 @@ let constr_of_global gr =
437
393
438
394
let constr_of_reference = constr_of_global
439
395
440
- let unsafe_constr_of_global gr =
441
- unsafe_global_instance (Global. env () ) gr
442
-
443
396
let constr_of_global_univ (gr ,u ) =
444
397
match gr with
445
398
| VarRef id -> mkVar id
@@ -513,25 +466,6 @@ let type_of_reference env r =
513
466
514
467
let type_of_global t = type_of_reference (Global. env () ) t
515
468
516
- let unsafe_type_of_reference env r =
517
- match r with
518
- | VarRef id -> Environ. named_type id env
519
- | ConstRef c ->
520
- let cb = Environ. lookup_constant c env in
521
- Typeops. type_of_constant_type env cb.const_type
522
-
523
- | IndRef ind ->
524
- let (mib, oib as specif) = Inductive. lookup_mind_specif env ind in
525
- let (_, inst), _ = unsafe_inductive_instance env ind in
526
- Inductive. type_of_inductive env (specif, inst)
527
-
528
- | ConstructRef (ind , _ as cstr ) ->
529
- let (mib,oib as specif) = Inductive. lookup_mind_specif env (inductive_of_constructor cstr) in
530
- let (_, inst), _ = unsafe_inductive_instance env ind in
531
- Inductive. type_of_constructor (cstr,inst) specif
532
-
533
- let unsafe_type_of_global t = unsafe_type_of_reference (Global. env () ) t
534
-
535
469
let fresh_sort_in_family env = function
536
470
| InProp -> prop_sort, ContextSet. empty
537
471
| InSet -> set_sort, ContextSet. empty
0 commit comments