From bb89852617bfc8c973ba6746a77d1c2913b720ad Mon Sep 17 00:00:00 2001 From: msozeau Date: Mon, 18 May 2009 16:07:55 +0000 Subject: Minor unification changes: - Primitive setup for firing typeclass resolution on-demand: add a flag to control resolution of remaining evars (e.g. typeclasses) during unification. - Prevent canonical projection resolution when no delta is allowed during unification (fixes incompatibility found in ssreflect). - Correctly check types when the head is an evar _or_ a meta in w_unify. Move [isEvar_or_Meta] to kernel/term.ml, it's used in two places now. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12131 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tactics/auto.ml | 1 + tactics/class_tactics.ml4 | 1 + tactics/rewrite.ml4 | 4 +++- tactics/tactics.ml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'tactics') diff --git a/tactics/auto.ml b/tactics/auto.ml index aceb5c5250..8a2578c302 100644 --- a/tactics/auto.ml +++ b/tactics/auto.ml @@ -708,6 +708,7 @@ let auto_unif_flags = { modulo_conv_on_closed_terms = Some full_transparent_state; use_metas_eagerly = false; modulo_delta = empty_transparent_state; + resolve_evars = true; } (* Try unification with the precompiled clause, then use registered Apply *) diff --git a/tactics/class_tactics.ml4 b/tactics/class_tactics.ml4 index f9485e64cd..78ef3c6fc8 100644 --- a/tactics/class_tactics.ml4 +++ b/tactics/class_tactics.ml4 @@ -103,6 +103,7 @@ let auto_unif_flags = { modulo_conv_on_closed_terms = Some full_transparent_state; use_metas_eagerly = true; modulo_delta = var_full_transparent_state; + resolve_evars = false; } let unify_e_resolve flags (c,clenv) gls = diff --git a/tactics/rewrite.ml4 b/tactics/rewrite.ml4 index 213f0d11e9..b981635eb7 100644 --- a/tactics/rewrite.ml4 +++ b/tactics/rewrite.ml4 @@ -272,6 +272,7 @@ let rewrite_unif_flags = { Unification.modulo_conv_on_closed_terms = None; Unification.use_metas_eagerly = true; Unification.modulo_delta = empty_transparent_state; + Unification.resolve_evars = true; } let conv_transparent_state = (Idpred.empty, Cpred.full) @@ -280,6 +281,7 @@ let rewrite2_unif_flags = { Unification.modulo_conv_on_closed_terms = Some conv_transparent_state; Unification.use_metas_eagerly = true; Unification.modulo_delta = empty_transparent_state; + Unification.resolve_evars = true; } let convertible env evd x y = @@ -320,7 +322,7 @@ let unify_eqn env sigma hypinfo t = let mvs = clenv_dependent false env' in clenv_pose_metas_as_evars env' mvs in - let evd' = Typeclasses.resolve_typeclasses ~fail:false env'.env env'.evd in + let evd' = Typeclasses.resolve_typeclasses ~fail:true env'.env env'.evd in let env' = { env' with evd = evd' } in let nf c = Evarutil.nf_evar ( evd') (Clenv.clenv_nf_meta env' c) in let c1 = nf c1 and c2 = nf c2 diff --git a/tactics/tactics.ml b/tactics/tactics.ml index f3f15630fa..3d3b220457 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -680,6 +680,7 @@ let elim_flags = { modulo_conv_on_closed_terms = Some full_transparent_state; use_metas_eagerly = true; modulo_delta = empty_transparent_state; + resolve_evars = false; } let elimination_clause_scheme with_evars allow_K elimclause indclause gl = -- cgit v1.2.3