aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/evarutil.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-18 09:31:37 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-18 09:31:37 +0000
commitd4fdeab05edd710bc0ae72a53f65e33d0b1f4ac2 (patch)
tree98ad70ca4cfcf8d7b32f812b1c3463e2241dc83c /pretyping/evarutil.ml
parentff0673211da215b5b712c44cd1fe59d967e19eea (diff)
Correction bug 1835 + correction bug occur-check résultant en un
"cannot define an evar twice" --Cette ligne, et les suivantes ci-dessous, seront ignorées-- M tacred.ml M evarutil.ml git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10815 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping/evarutil.ml')
-rw-r--r--pretyping/evarutil.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/pretyping/evarutil.ml b/pretyping/evarutil.ml
index 13ccefe1e..f7b4e1279 100644
--- a/pretyping/evarutil.ml
+++ b/pretyping/evarutil.ml
@@ -857,6 +857,7 @@ let rec invert_definition env evd (evk,argsv as ev) rhs =
| Rel i when i>k -> project_variable env' (mkRel (i-k)) k t
| Var id -> project_variable env' t k t
| Evar (evk',args' as ev') ->
+ if evk = evk' then error_occur_check env (evars_of evd) evk rhs;
(* Evar/Evar problem (but left evar is virtual) *)
let projs' =
array_map_to_list
@@ -904,6 +905,8 @@ and evar_define env (evk,_ as ev) rhs evd =
try
let (evd',body) = invert_definition env evd ev rhs in
if occur_meta body then error "Meta cannot occur in evar body";
+ (* invert_definition may have instantiate some evars of rhs with evk *)
+ (* so we recheck acyclicity *)
if occur_evar evk body then error_occur_check env (evars_of evd) evk body;
(* needed only if an inferred type *)
let body = refresh_universes body in