diff options
| author | filliatr | 1999-12-07 09:23:34 +0000 |
|---|---|---|
| committer | filliatr | 1999-12-07 09:23:34 +0000 |
| commit | 59263ca55924e2f43097ae2296f541b153981bf8 (patch) | |
| tree | faae53835f16e3efc616e6a1dfadddb3d3d4531a | |
| parent | 8e1c1ee13bbcab295a92928557515b4239e4bc46 (diff) | |
correction bug construct_reference
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@219 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | kernel/typeops.ml | 7 | ||||
| -rw-r--r-- | kernel/typeops.mli | 3 | ||||
| -rw-r--r-- | library/declare.ml | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/kernel/typeops.ml b/kernel/typeops.ml index a12c6803ad..255e8d7aa5 100644 --- a/kernel/typeops.ml +++ b/kernel/typeops.ml @@ -74,13 +74,6 @@ let hyps_inclusion env sigma (idl1,tyl1) (idl2,tyl2) = (* Checks if the given context of variables [hyps] is included in the current context of [env]. *) -let construct_reference id env sigma hyps = - let hyps' = var_context env in - if hyps_inclusion env sigma hyps hyps' then - Array.of_list (List.map (fun id -> VAR id) (ids_of_sign hyps)) - else - error_reference_variables CCI env id - let check_hyps id env sigma hyps = let hyps' = var_context env in if not (hyps_inclusion env sigma hyps hyps') then diff --git a/kernel/typeops.mli b/kernel/typeops.mli index a271dc9ecb..8a2974f6c8 100644 --- a/kernel/typeops.mli +++ b/kernel/typeops.mli @@ -2,6 +2,7 @@ (*i*) open Names +open Sign open Univ open Term open Evd @@ -87,3 +88,5 @@ val find_case_dep_nparams : constr -> bool * (int * constr list * constr list) val type_inst_construct : env -> 'a evar_map -> int -> constr -> constr + +val hyps_inclusion : env -> 'a evar_map -> var_context -> var_context -> bool diff --git a/library/declare.ml b/library/declare.ml index 5508432679..c756d6169f 100644 --- a/library/declare.ml +++ b/library/declare.ml @@ -10,6 +10,8 @@ open Sign open Constant open Inductive open Reduction +open Type_errors +open Typeops open Libobject open Lib open Impargs @@ -233,8 +235,10 @@ let global_operator sp id = construct_operator (Global.env()) sp id let construct_reference env kind id = let sp = Nametab.sp_of_id kind id in try - let (oper,_) = construct_operator env sp id in - let hyps = Global.var_context () in + let (oper,hyps) = construct_operator env sp id in + let hyps' = Global.var_context () in + if not (hyps_inclusion env Evd.empty hyps hyps') then + error_reference_variables CCI env id; let ids = ids_of_sign hyps in DOPN(oper, Array.of_list (List.map (fun id -> VAR id) ids)) with Not_found -> |
