diff options
-rw-r--r-- | checker/reduction.ml | 3 | ||||
-rw-r--r-- | kernel/reduction.ml | 4 | ||||
-rw-r--r-- | test-suite/failure/prop-set-proof-irrelevance.v | 12 |
3 files changed, 17 insertions, 2 deletions
diff --git a/checker/reduction.ml b/checker/reduction.ml index 1f963d125..a86d23ecb 100644 --- a/checker/reduction.ml +++ b/checker/reduction.ml @@ -152,7 +152,8 @@ type conv_pb = let sort_cmp univ pb s0 s1 = match (s0,s1) with - | (Prop c1, Prop c2) -> if c1 = Pos & c2 = Null then raise NotConvertible + | (Prop c1, Prop c2) when pb = CUMUL -> if c1 = Pos & c2 = Null then raise NotConvertible + | (Prop c1, Prop c2) -> if c1 <> c2 then raise NotConvertible | (Prop c1, Type u) -> (match pb with CUMUL -> () diff --git a/kernel/reduction.ml b/kernel/reduction.ml index d3168a9a1..55a7ca884 100644 --- a/kernel/reduction.ml +++ b/kernel/reduction.ml @@ -183,9 +183,11 @@ type conv_pb = let sort_cmp pb s0 s1 cuniv = match (s0,s1) with - | (Prop c1, Prop c2) -> + | (Prop c1, Prop c2) when pb = CUMUL -> if c1 = Null or c2 = Pos then cuniv (* Prop <= Set *) else raise NotConvertible + | (Prop c1, Prop c2) -> + if c1 = c2 then cuniv else raise NotConvertible | (Prop c1, Type u) when pb = CUMUL -> assert (is_univ_variable u); cuniv | (Type u1, Type u2) -> assert (is_univ_variable u2); diff --git a/test-suite/failure/prop-set-proof-irrelevance.v b/test-suite/failure/prop-set-proof-irrelevance.v new file mode 100644 index 000000000..ad4941084 --- /dev/null +++ b/test-suite/failure/prop-set-proof-irrelevance.v @@ -0,0 +1,12 @@ +Require Import ProofIrrelevance. + +Lemma proof_irrelevance_set : forall (P : Set) (p1 p2 : P), p1 = p2. + exact proof_irrelevance. +Qed. + +Lemma paradox : False. + assert (H : 0 <> 1) by discriminate. + apply H. + Fail apply proof_irrelevance. (* inlined version is rejected *) + apply proof_irrelevance_set. +Qed. |