summaryrefslogtreecommitdiff
path: root/kernel/safe_typing.ml
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <smimram@debian.org>2006-11-21 21:38:49 +0000
committerGravatar Samuel Mimram <smimram@debian.org>2006-11-21 21:38:49 +0000
commit208a0f7bfa5249f9795e6e225f309cbe715c0fad (patch)
tree591e9e512063e34099782e2518573f15ffeac003 /kernel/safe_typing.ml
parentde0085539583f59dc7c4bf4e272e18711d565466 (diff)
Imported Upstream version 8.1~gammaupstream/8.1.gamma
Diffstat (limited to 'kernel/safe_typing.ml')
-rw-r--r--kernel/safe_typing.ml36
1 files changed, 21 insertions, 15 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index 95092814..c4d9c991 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: safe_typing.ml 8898 2006-06-05 23:15:51Z letouzey $ *)
+(* $Id: safe_typing.ml 9310 2006-10-28 19:35:09Z herbelin $ *)
open Util
open Names
@@ -119,6 +119,12 @@ type global_declaration =
| ConstantEntry of constant_entry
| GlobalRecipe of Cooking.recipe
+let hcons_constant_type = function
+ | NonPolymorphicType t ->
+ NonPolymorphicType (hcons1_constr t)
+ | PolymorphicArity (ctx,s) ->
+ PolymorphicArity (map_rel_context hcons1_constr ctx,s)
+
let hcons_constant_body cb =
let body = match cb.const_body with
None -> None
@@ -127,28 +133,28 @@ let hcons_constant_body cb =
in
{ cb with
const_body = body;
- const_type = hcons1_constr cb.const_type }
+ const_type = hcons_constant_type cb.const_type }
let add_constant dir l decl senv =
check_label l senv.labset;
- let kn = make_con senv.modinfo.modpath dir l in
+ let kn = make_con senv.modinfo.modpath dir l in
let cb =
match decl with
- | ConstantEntry ce -> translate_constant senv.env kn ce
- | GlobalRecipe r ->
- let cb = translate_recipe senv.env kn r in
- if dir = empty_dirpath then hcons_constant_body cb else cb
+ | ConstantEntry ce -> translate_constant senv.env kn ce
+ | GlobalRecipe r ->
+ let cb = translate_recipe senv.env kn r in
+ if dir = empty_dirpath then hcons_constant_body cb else cb
in
let env' = Environ.add_constraints cb.const_constraints senv.env in
let env'' = Environ.add_constant kn cb env' in
- kn, { old = senv.old;
- env = env'';
- modinfo = senv.modinfo;
- labset = Labset.add l senv.labset;
- revsign = (l,SPBconst cb)::senv.revsign;
- revstruct = (l,SEBconst cb)::senv.revstruct;
- imports = senv.imports;
- loads = senv.loads }
+ kn, { old = senv.old;
+ env = env'';
+ modinfo = senv.modinfo;
+ labset = Labset.add l senv.labset;
+ revsign = (l,SPBconst cb)::senv.revsign;
+ revstruct = (l,SEBconst cb)::senv.revstruct;
+ imports = senv.imports;
+ loads = senv.loads }
(* Insertion of inductive types. *)