aboutsummaryrefslogtreecommitdiff
path: root/vernac
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-05-29 14:51:49 +0200
committerPierre-Marie Pédrot2018-06-24 18:20:26 +0200
commit568f3b69d407f7b5a47d1fdd6ca2bbf3edb5be72 (patch)
tree1bb4cc7dfa6976bb530080441ea1b1d448a0ceb4 /vernac
parente42b3b188b365159a60851bb0d4214068bb74dd4 (diff)
Further cleaning of the side-effect API.
We remove internal functions and types from the API.
Diffstat (limited to 'vernac')
-rw-r--r--vernac/lemmas.ml16
1 files changed, 7 insertions, 9 deletions
diff --git a/vernac/lemmas.ml b/vernac/lemmas.ml
index 1b086d69cc..880a11becd 100644
--- a/vernac/lemmas.ml
+++ b/vernac/lemmas.ml
@@ -71,15 +71,13 @@ let adjust_guardness_conditions const = function
List.interval 0 (List.length ((lam_assum c))))
lemma_guard (Array.to_list fixdefs) in
*)
- let add c cb e =
- let exists c e =
- try ignore(Environ.lookup_constant c e); true
- with Not_found -> false in
- if exists c e then e else Environ.add_constant c cb e in
- let env = List.fold_left (fun env { eff } ->
- let fold acc eff = add eff.seff_constant eff.seff_body acc in
- List.fold_left fold env eff)
- env (Safe_typing.side_effects_of_private_constants eff) in
+ let fold env eff =
+ try
+ let _ = Environ.lookup_constant eff.seff_constant env in
+ env
+ with Not_found -> Environ.add_constant eff.seff_constant eff.seff_body env
+ in
+ let env = List.fold_left fold env (Safe_typing.side_effects_of_private_constants eff) in
let indexes =
search_guard env
possible_indexes fixdecls in