From d4fdeab05edd710bc0ae72a53f65e33d0b1f4ac2 Mon Sep 17 00:00:00 2001 From: herbelin Date: Fri, 18 Apr 2008 09:31:37 +0000 Subject: Correction bug 1835 + correction bug occur-check résultant en un "cannot define an evar twice" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --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 --- pretyping/evarutil.ml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pretyping/evarutil.ml') 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 -- cgit v1.2.3