aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/util.ml
diff options
context:
space:
mode:
authorGravatar puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-07-29 14:27:58 +0000
committerGravatar puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-07-29 14:27:58 +0000
commit222f9323945f10eb6e7ee84331a7bf5a65c5cbff (patch)
tree787e5f63976336f193f69a3449778f6cd08c8ad9 /lib/util.ml
parent6cf2f61e672f1a0aa6c06589d8b64c7958167a62 (diff)
Coq_omega: replaced generic = on constr by eq_constr
Util: Added list_assoc_f git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14350 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 6a69c58d2..94b1d37c2 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -824,6 +824,10 @@ let list_fold_map' f l e =
let list_map_assoc f = List.map (fun (x,a) -> (x,f a))
+let rec list_assoc_f f a = function
+ | (x, e) :: xs -> if f a x then e else list_assoc_f f a xs
+ | [] -> raise Not_found
+
(* Specification:
- =p= is set equality (double inclusion)
- f such that \forall l acc, (f l acc) =p= append (f l []) acc