aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorbarras2004-01-12 19:50:50 +0000
committerbarras2004-01-12 19:50:50 +0000
commitf6c01f30af292343d0bb498e475214b352c5700f (patch)
treea1efb7c3407cd3d13e84735f6fbc08a25b618993 /pretyping
parent34f9510f9ed82dbd4b26bf8abe658e53b33e412d (diff)
Set is not always impredicative
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5194 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/retyping.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/pretyping/retyping.ml b/pretyping/retyping.ml
index 43218ca725..28e9b4c077 100644
--- a/pretyping/retyping.ml
+++ b/pretyping/retyping.ml
@@ -90,9 +90,13 @@ let typeur sigma metamap =
| Sort (Prop c) -> type_0
| Sort (Type u) -> Type (Univ.super u)
| Prod (name,t,c2) ->
- (match (sort_of (push_rel (name,None,t) env) c2) with
- | Prop _ as s -> s
- | Type u2 as s -> s (*Type Univ.dummy_univ*))
+ (match (sort_of env t, sort_of (push_rel (name,None,t) env) c2) with
+ | _, (Prop Null as s) -> s
+ | Prop _, (Prop Pos as s) -> s
+ | Type _, (Prop Pos as s) when
+ Environ.engagement env = Some ImpredicativeSet -> s
+ | Type _ as s, Prop Pos -> s
+ | _, (Type u2 as s) -> s (*Type Univ.dummy_univ*))
| App(f,args) -> sort_of_atomic_type env sigma (type_of env f) args
| Lambda _ | Fix _ | Construct _ ->
anomaly "sort_of: Not a type (1)"