aboutsummaryrefslogtreecommitdiff
path: root/kernel/instantiate.ml
diff options
context:
space:
mode:
authorfilliatr1999-10-08 08:18:57 +0000
committerfilliatr1999-10-08 08:18:57 +0000
commitfd28f10096f82ef133bbf10512c8bee617b6b8b3 (patch)
tree96892fb5b66038cef8ca48b0cc3f0383e38fc9a5 /kernel/instantiate.ml
parent610caabdaac2f9ca635737839f645cc870d83975 (diff)
deplacements des var. ex. hors du noyau
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@93 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/instantiate.ml')
-rw-r--r--kernel/instantiate.ml47
1 files changed, 2 insertions, 45 deletions
diff --git a/kernel/instantiate.ml b/kernel/instantiate.ml
index 9b4c1ae710..679789d6ce 100644
--- a/kernel/instantiate.ml
+++ b/kernel/instantiate.ml
@@ -9,7 +9,6 @@ open Term
open Sign
open Constant
open Inductive
-open Evd
open Environ
let is_id_inst ids args =
@@ -41,7 +40,7 @@ let constant_type env k =
let constant_value env k =
let (sp,args) = destConst k in
let cb = lookup_constant sp env in
- if not cb.const_opaque & defined_const env k then
+ if not cb.const_opaque & defined_constant env k then
match cb.const_body with
Some { contents = Cooked body } ->
instantiate_constr
@@ -53,52 +52,10 @@ let constant_value env k =
[< 'sTR "a defined constant as no body." >]
else failwith "opaque"
-
-(* existential_type gives the type of an existential *)
-let existential_type env k =
- let (sp,args) = destConst k in
- let evd = Evd.map (evar_map env) sp in
- instantiate_constr
- (ids_of_sign evd.evar_hyps) evd.evar_concl.body (Array.to_list args)
-
-(* existential_value gives the value of a defined existential *)
-let existential_value env k =
- let (sp,args) = destConst k in
- if defined_const env k then
- let evd = Evd.map (evar_map env) sp in
- match evd.evar_body with
- | EVAR_DEFINED c ->
- instantiate_constr (ids_of_sign evd.evar_hyps) c (Array.to_list args)
- | _ -> anomalylabstrm "termenv__existential_value"
- [< 'sTR"The existential variable code just registered a" ;
- 'sPC ; 'sTR"grave internal error." >]
- else
- failwith "undefined existential"
-
-(* Constants or existentials. *)
-
-(* gives the value of a const *)
-let const_or_ex_value env = function
- | DOPN (Const sp, _) as k ->
- if is_existential k then
- existential_value env k
- else
- constant_value env k
- | _ -> invalid_arg "const_or_ex_value"
-
-(* gives the type of a const *)
-let const_or_ex_type env = function
- | DOPN (Const sp, _) as k ->
- if is_existential k then
- existential_type env k
- else
- (constant_type env k).body
- | _ -> invalid_arg "const_or_ex_type"
-
let const_abst_opt_value env c =
match c with
| DOPN(Const sp,_) ->
- if evaluable_const env c then Some (const_or_ex_value env c) else None
+ if evaluable_constant env c then Some (constant_value env c) else None
| DOPN(Abst sp,_) ->
if evaluable_abst env c then Some (abst_value env c) else None
| _ -> invalid_arg "const_abst_opt_value"