Commit 69af59b 1 parent 3a488f5 commit 69af59b Copy full SHA for 69af59b
File tree 4 files changed +25
-5
lines changed
4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -1486,6 +1486,13 @@ Module Sort.
1486
1486
1487
1487
#[global] Instance eq_dec_sort {univ} `{EqDec univ} : EqDec (t_ univ) := ltac:(intros s s'; decide equality).
1488
1488
1489
+ Definition map {u u'} (f : u -> u') s :=
1490
+ match s with
1491
+ | sType u => sType (f u)
1492
+ | sProp => sProp
1493
+ | sSProp => sSProp
1494
+ end .
1495
+
1489
1496
Definition on_sort {univ} {T} (P: univ -> T) (def: T) (s : t_ univ) :=
1490
1497
match s with
1491
1498
| sProp | sSProp => def
Original file line number Diff line number Diff line change @@ -8,9 +8,14 @@ Local Existing Instance config.default_checker_flags.
8
8
Local Existing Instance default_fuel.
9
9
10
10
11
+ Definition refresh_universe u :=
12
+ if Universe .is_level u then u else fresh_universe.
13
+
14
+ Definition refresh_sort_universe := Sort.map refresh_universe.
15
+
11
16
Fixpoint refresh_universes (t : term) {struct t} :=
12
17
match t with
13
- | tSort s => tSort (if Universe .is_level s then s else fresh_universe )
18
+ | tSort s => tSort (refresh_sort_universe s )
14
19
| tProd na b t => tProd na b (refresh_universes t)
15
20
| tLetIn na b t' t => tLetIn na b t' (refresh_universes t)
16
21
| _ => t
Original file line number Diff line number Diff line change @@ -28,10 +28,14 @@ Definition proj2 (t : term) : term
28
28
Definition proj (b : bool) (t : term) : term
29
29
:= tProj (mkProjection sigma_ind 2 (if b then 0 else S 0)) t.
30
30
31
+ Definition refresh_universe u :=
32
+ if Universe .is_level u then u else fresh_universe.
33
+
34
+ Definition refresh_sort_universe := Sort.map refresh_universe.
31
35
32
36
Fixpoint refresh_universes (t : term) {struct t} :=
33
37
match t with
34
- | tSort s => tSort (if Universe .is_level s then s else fresh_universe )
38
+ | tSort s => tSort (refresh_sort_universe s )
35
39
| tProd na b t => tProd na b (refresh_universes t)
36
40
| tLetIn na b t' t => tLetIn na b t' (refresh_universes t)
37
41
| _ => t
@@ -108,8 +112,8 @@ with tsl_term (fuel : nat) (Σ : global_env_ext) (E : tsl_table) (Γ : context)
108
112
| tRel n => ret (tRel n)
109
113
110
114
| tSort s =>
111
- ret (pair (tSort fresh_universe)
112
- (tLambda (nNamed "A") (tSort fresh_universe) (tProd nAnon (tRel 0) (tSort fresh_universe)))
115
+ ret (pair (tSort (sType fresh_universe) )
116
+ (tLambda (nNamed "A") (tSort (sType fresh_universe)) (tProd nAnon (tRel 0) (tSort (sType fresh_universe) )))
113
117
(tSort s)
114
118
(tLambda (nNamed "A") (tSort s) (tProd nAnon (tRel 0) (tSort s))))
115
119
Original file line number Diff line number Diff line change @@ -207,10 +207,14 @@ Definition tsl_mind_body (ΣE : tsl_context) (mp : modpath) (kn : kername)
207
207
exact (fun A Γ' => Γ' ,, vass (decl_name A) (tsl Γ' (decl_type A))).
208
208
Defined .
209
209
210
+ Definition refresh_universe u :=
211
+ if Universe .is_level u then u else fresh_universe.
212
+
213
+ Definition refresh_sort_universe := Sort.map refresh_universe.
210
214
211
215
Fixpoint refresh_universes (t : term) {struct t} :=
212
216
match t with
213
- | tSort s => tSort (if Universe .is_level s then s else fresh_universe )
217
+ | tSort s => tSort (refresh_sort_universe s )
214
218
| tProd na b t => tProd na b (refresh_universes t)
215
219
| tLetIn na b t' t => tLetIn na b t' (refresh_universes t)
216
220
| tCast x x0 x1 => tCast (refresh_universes x) x0 (refresh_universes x1)
You can’t perform that action at this time.
0 commit comments