diff options
| author | notin | 2007-01-22 18:06:35 +0000 |
|---|---|---|
| committer | notin | 2007-01-22 18:06:35 +0000 |
| commit | 90a2cea28df5ecdf9e2cdc4351aad5f6a993a003 (patch) | |
| tree | b9994cf9ff1163facd312b96918d929f5e0ff7ae /kernel/environ.ml | |
| parent | 612ea3d4b3c7d7e00616b009050803cd7b7f763e (diff) | |
Correction du bug #1315:
- ajouts des opérations clear_evar_hyps_in_evar,
clear_evar_hyps_in_constr et clear_evar_hyps dans Evarutil, qui
permettent de supprimer des hypothèses dans le contexte des evars,
en créant une nouvelle evar avec un contexte restreint;
- adaptation de clear_hyps dans Logic pour qu'elle mette à jour le
contexte des evars;
- adaptation de prim_refiner pour qu'elle renvoie le evar_map modifié;
- déplacement de la tactique Change_evars dans prim_rule.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9518 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/environ.ml')
| -rw-r--r-- | kernel/environ.ml | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/kernel/environ.ml b/kernel/environ.ml index 57043057a3..2d821991e0 100644 --- a/kernel/environ.ml +++ b/kernel/environ.ml @@ -241,9 +241,9 @@ let global_vars_set env constr = let rec filtrec acc c = let vl = vars_of_global env c in let acc = List.fold_right Idset.add vl acc in - fold_constr filtrec acc c + fold_constr filtrec acc c in - filtrec Idset.empty constr + filtrec Idset.empty constr (* like [global_vars] but don't get through evars *) let global_vars_set_drop_evar env constr = @@ -339,18 +339,6 @@ type unsafe_type_judgment = { let compile_constant_body = Cbytegen.compile_constant_body -(*s Special functions for the refiner (logic.ml) *) - -let clear_hyps ids check (ctxt,vals) = - let ctxt,vals,rmv = - List.fold_right2 (fun (id,_,_ as d) v (ctxt,vals,rmv) -> - if List.mem id ids then (ctxt,vals,id::rmv) - else begin - check rmv d; - (d::ctxt,v::vals,rmv) - end) ctxt vals ([],[],[]) - in ((ctxt,vals),rmv) - exception Hyp_not_found let rec apply_to_hyp (ctxt,vals) id f = @@ -393,3 +381,16 @@ let insert_after_hyp (ctxt,vals) id d check = | [],[] -> raise Hyp_not_found | _, _ -> assert false in aux ctxt vals + +(* To be used in Logic.clear_hyps *) +let remove_hyps ids check (ctxt, vals) = + let ctxt,vals,rmv = + List.fold_right2 (fun (id,_,_ as d) v (ctxt,vals,rmv) -> + if List.mem id ids then + (ctxt,vals,id::rmv) + else + let nd = check d in + (nd::ctxt,v::vals,rmv)) + ctxt vals ([],[],[]) + in ((ctxt,vals),rmv) + |
