aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2000-03-17 20:35:30 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2000-03-17 20:35:30 +0000
commit8bff8bbd620e54022c2fea81542bf1cbc18fafb0 (patch)
tree4a3b491e827ce944bc2bf6cf619f12816fd29e88 /kernel
parentff9a59ac99ea7a58c2be0a96a6b6b1482a592b2a (diff)
Correction bug des réduction 'deltat' et renommage 'deltat' en 'evar'
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@322 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/reduction.ml30
-rw-r--r--kernel/reduction.mli20
2 files changed, 25 insertions, 25 deletions
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index f399dfdf0..b6101a436 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -381,14 +381,9 @@ let whd_betadelta_stack env sigma =
let whd_betadelta env sigma c = applist(whd_betadelta_stack env sigma c [])
-let whd_betadeltat_stack env sigma =
+let whd_betaevar_stack env sigma =
let rec whrec x l =
match x with
- | DOPN(Const _,_) ->
- if evaluable_constant env x then
- whrec (constant_value env x) l
- else
- (x,l)
| DOPN(Evar ev,_) ->
if Evd.is_defined sigma ev then
whrec (existential_value sigma x) l
@@ -405,11 +400,12 @@ let whd_betadeltat_stack env sigma =
(match l with
| [] -> (x,l)
| (a::m) -> stacklam whrec [a] c m)
+ | DOPN(Const _,_) -> (x,l)
| x -> (x,l)
in
whrec
-let whd_betadeltat env sigma c = applist(whd_betadeltat_stack env sigma c [])
+let whd_betaevar env sigma c = applist(whd_betaevar_stack env sigma c [])
let whd_betadeltaeta_stack env sigma =
let rec whrec x stack =
@@ -560,14 +556,9 @@ let whd_betaiota_stack env sigma =
let whd_betaiota env sigma x = applist (whd_betaiota_stack env sigma x [])
-let whd_betadeltatiota_stack env sigma =
+let whd_betaiotaevar_stack env sigma =
let rec whrec x stack =
match x with
- | DOPN(Const _,_) ->
- if evaluable_constant env x then
- whrec (constant_value env x) stack
- else
- (x,stack)
| DOPN(Evar ev,_) ->
if Evd.is_defined sigma ev then
whrec (existential_value sigma x) stack
@@ -595,12 +586,13 @@ let whd_betadeltatiota_stack env sigma =
| DOPN(Fix _,_) ->
let (reduced,(fix,stack)) = reduce_fix whrec x stack in
if reduced then whrec fix stack else (fix,stack)
+ | DOPN(Const _,_) -> (x,stack)
| x -> (x,stack)
in
whrec
-let whd_betadeltatiota env sigma x =
- applist(whd_betadeltatiota_stack env sigma x [])
+let whd_betaiotaevar env sigma x =
+ applist(whd_betaiotaevar_stack env sigma x [])
let whd_betadeltaiota_stack env sigma =
let rec bdi_rec x stack =
@@ -1167,7 +1159,8 @@ let make_constructor_summary (hyps,lc,nconstr,ntypes) ind params =
let make_arity env sigma (hyps,arity) ind params =
let ((sp,i),ctxt) = ind in
- let arity' = instantiate_type (Sign.ids_of_sign hyps) arity (Array.to_list ctxt) in
+ let arity' =
+ instantiate_type (Sign.ids_of_sign hyps) arity (Array.to_list ctxt) in
match splay_prod env sigma (prod_applist (body_of_type arity') params) with
| (sign, DOP0 (Sort s)) -> (sign,s)
| _ -> anomaly "make_arity: the conclusion of this arity is not a sort"
@@ -1312,11 +1305,16 @@ let rec whd_ise1 sigma = function
else
k
| DOP2(Cast,c,_) -> whd_ise1 sigma c
+ (* A quoi servait cette ligne ???
| DOP0(Sort(Type _)) -> DOP0(Sort(Type dummy_univ))
+ *)
| c -> c
let nf_ise1 sigma = strong (fun _ -> whd_ise1) empty_env sigma
+(* A form of [whd_ise1] with type "reduction_function" *)
+let whd_evar env = whd_ise1
+
(* Same as whd_ise1, but replaces the remaining ISEVAR by Metavariables
* Similarly we have is_fmachine1_metas and is_resolve1_metas *)
diff --git a/kernel/reduction.mli b/kernel/reduction.mli
index 6638f30ee..b953907db 100644
--- a/kernel/reduction.mli
+++ b/kernel/reduction.mli
@@ -66,14 +66,15 @@ val whd_delta_stack : 'a stack_reduction_function
val whd_delta : 'a reduction_function
val whd_betadelta_stack : 'a stack_reduction_function
val whd_betadelta : 'a reduction_function
-val whd_betadeltat_stack : 'a stack_reduction_function
-val whd_betadeltat : 'a reduction_function
-val whd_betadeltatiota_stack : 'a stack_reduction_function
-val whd_betadeltatiota : 'a reduction_function
+val whd_betaevar_stack : 'a stack_reduction_function
+val whd_betaevar : 'a reduction_function
+val whd_betaiotaevar_stack : 'a stack_reduction_function
+val whd_betaiotaevar : 'a reduction_function
val whd_betadeltaeta_stack : 'a stack_reduction_function
val whd_betadeltaeta : 'a reduction_function
val whd_betadeltaiotaeta_stack : 'a stack_reduction_function
val whd_betadeltaiotaeta : 'a reduction_function
+val whd_evar : 'a reduction_function
val beta_applist : (constr * constr list) -> constr
@@ -180,14 +181,15 @@ val whd_meta : (int * constr) list -> constr -> constr
val plain_instance : (int * constr) list -> constr -> constr
val instance : (int * constr) list -> 'a reduction_function
-(* [whd_ise] raise [Uninstantiated_evar] if an evar remains uninstantiated *)
-(* the *[_ise1]* leave uninstantiated evar as it *)
+(* [whd_ise] raise [Uninstantiated_evar] if an evar remains uninstantiated; *)
+(* *[whd_ise1]* is synonymous of *[whd_evar empty_env]* and *[nf_ise1]* of *)
+(* *[strong whd_evar empty_env]*: they leave uninstantiated evar as it *)
-exception Uninstantiated_evar of int
-
-val whd_ise : 'a evar_map -> constr -> constr
val whd_ise1 : 'a evar_map -> constr -> constr
val nf_ise1 : 'a evar_map -> constr -> constr
+exception Uninstantiated_evar of int
+val whd_ise : 'a evar_map -> constr -> constr
+
val whd_ise1_metas : 'a evar_map -> constr -> constr
(*s Obsolete Reduction Functions *)