diff options
Diffstat (limited to 'kernel/pre_env.ml')
-rw-r--r-- | kernel/pre_env.ml | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/pre_env.ml b/kernel/pre_env.ml index e543c4e68..b98a3d3ae 100644 --- a/kernel/pre_env.ml +++ b/kernel/pre_env.ml @@ -49,6 +49,7 @@ type named_vals = (Id.t * lazy_val) list type env = { env_globals : globals; env_named_context : named_context; + env_named_context_map : named_declaration Id.Map.t; env_named_vals : named_vals; env_rel_context : rel_context; env_rel_val : lazy_val list; @@ -57,9 +58,9 @@ type env = { env_conv_oracle : Conv_oracle.oracle; retroknowledge : Retroknowledge.retroknowledge } -type named_context_val = named_context * named_vals +type named_context_val = named_context * named_declaration Id.Map.t * named_vals -let empty_named_context_val = [],[] +let empty_named_context_val = [], Id.Map.empty, [] let empty_env = { env_globals = { @@ -68,6 +69,7 @@ let empty_env = { env_modules = MPmap.empty; env_modtypes = MPmap.empty}; env_named_context = empty_named_context; + env_named_context_map = Id.Map.empty; env_named_vals = []; env_rel_context = empty_rel_context; env_rel_val = []; @@ -103,10 +105,10 @@ let env_of_rel n env = (* Named context *) -let push_named_context_val d (ctxt,vals) = +let push_named_context_val d (ctxt,map,vals) = let id,_,_ = d in let rval = ref VKnone in - Context.add_named_decl d ctxt, (id,rval)::vals + Context.add_named_decl d ctxt, Id.Map.add id d map, (id,rval)::vals let push_named d env = (* if not (env.env_rel_context = []) then raise (ASSERT env.env_rel_context); @@ -115,6 +117,7 @@ let push_named d env = let rval = ref VKnone in { env_globals = env.env_globals; env_named_context = Context.add_named_decl d env.env_named_context; + env_named_context_map = Id.Map.add id d env.env_named_context_map; env_named_vals = (id, rval) :: env.env_named_vals; env_rel_context = env.env_rel_context; env_rel_val = env.env_rel_val; |