Skip to content

Commit 609d11e

Browse files
committed
Fixing issue CoqHott#6: forcing of singleton Prop.
1 parent 8fb4688 commit 609d11e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/fPlugin.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,14 @@ let force_translate_inductive cat ind ids =
174174
Array.fold_left fold (sigma, []) mib.mind_packets
175175
in
176176
let make_one_entry params body (sigma, bodies_) =
177-
(* Heuristic for the return type. Can we do better? *)
178177
let (sigma, s) =
179-
if Sorts.family_leq Sorts.InType body.mind_kelim then
180-
let sigma, s = Evarutil.new_Type sigma in
181-
(sigma, EConstr.to_constr sigma s)
182-
else
183-
(sigma, mkProp)
178+
match body.mind_arity with
179+
| RegularArity {mind_sort=s} when Sorts.(is_prop s || is_sprop s) ->
180+
(* Impredicative sorts are stable by quantification over forcing conditions *)
181+
(sigma, mkSort s)
182+
| _ ->
183+
let sigma, s = Evarutil.new_Type sigma in
184+
(sigma, EConstr.to_constr sigma s)
184185
in
185186
let (sigma, arity) =
186187
(* On obtient l'arité de l'inductif en traduisant le type de chaque indice

test/Test.v

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ _force (fun A n (v : vect A n) =>
2727
|consv _ _ x r => 1
2828
end).
2929
exact I.
30-
Qed.
30+
Qed.
31+
32+
Forcing Translate and using Obj Hom.
33+
Forcing Translate iff using Obj Hom.

0 commit comments

Comments
 (0)