diff options
| author | ppedrot | 2013-10-05 17:44:45 +0000 |
|---|---|---|
| committer | ppedrot | 2013-10-05 17:44:45 +0000 |
| commit | 65eec025bc0b581fae1af78f18d1a8666b76e69b (patch) | |
| tree | 09a1d670468a2f141543c51a997f607f68eadef2 /pretyping/evd.ml | |
| parent | 29301ca3587f2069278745df83ad46717a3108a9 (diff) | |
Moving side effects into evar_map. There was no reason to keep another
state out of one we were threading all the way along. This should be
safer, as one cannot forego side effects accidentally by manipulating
explicitly the [sigma] container.
Still, this patch raised the issue of badly used evar maps. There
is an ad-hoc workaround (i.e. a hack) in Rewrite to handle the
fact it uses evar maps in an unorthodox way.
Likewise, that mean we have to revert all contrib patches that added
effect threading...
There was also a dubious use of side effects in their toplevel handling,
that duplicates them, leading to the need of a rather unsafe List.uniquize
afterwards. It should be investigaged.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16850 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping/evd.ml')
| -rw-r--r-- | pretyping/evd.ml | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/pretyping/evd.ml b/pretyping/evd.ml index 1aa8997710..84eba701ed 100644 --- a/pretyping/evd.ml +++ b/pretyping/evd.ml @@ -200,7 +200,8 @@ type evar_map = { univ_cstrs : Univ.universes; conv_pbs : evar_constraint list; last_mods : Evar.Set.t; - metas : clbinding Metamap.t + metas : clbinding Metamap.t; + effects : Declareops.side_effects; } (*** Lifting primitive from EvarMap. ***) @@ -361,6 +362,7 @@ let empty = { conv_pbs = []; last_mods = Evar.Set.empty; metas = Metamap.empty; + effects = Declareops.no_seff; } let has_undefined evd = not (EvMap.is_empty evd.undf_evars) @@ -463,6 +465,17 @@ let collect_evars c = collrec Evar.Set.empty c (**********************************************************) +(* Side effects *) + +let emit_side_effects eff evd = + { evd with effects = Declareops.union_side_effects eff evd.effects; } + +let drop_side_effects evd = + { evd with effects = Declareops.no_seff; } + +let eval_side_effects evd = evd.effects + +(**********************************************************) (* Sort variables *) let new_univ_variable evd = @@ -659,15 +672,11 @@ type open_constr = evar_map * constr type ['a] *) type 'a sigma = { it : 'a ; - eff : Declareops.side_effects; sigma : evar_map } let sig_it x = x.it -let sig_eff x = x.eff let sig_sig x = x.sigma -let emit_side_effects eff x = - { x with eff = Declareops.union_side_effects eff x.eff } (**********************************************************) (* Failure explanation *) |
