aboutsummaryrefslogtreecommitdiffhomepage
path: root/engine
diff options
context:
space:
mode:
authorGravatar Cyprien Mangin <cyprien.mangin@m4x.org>2016-06-03 08:07:30 +0200
committerGravatar Cyprien Mangin <cyprien.mangin@m4x.org>2016-06-14 06:21:30 +0200
commit591b3c37c980a092f0d2abadd8bdf23de3a38bcb (patch)
tree179736f620e7ccfc953ff7ff4ba2fd7973015e15 /engine
parentdae4d95910bbdfabe8a8436ab954092ef4773e7d (diff)
Fix usage of Pervasives in goal selectors.
Diffstat (limited to 'engine')
-rw-r--r--engine/proofview.ml9
1 files changed, 4 insertions, 5 deletions
diff --git a/engine/proofview.ml b/engine/proofview.ml
index e497066b7..b8f49a9c8 100644
--- a/engine/proofview.ml
+++ b/engine/proofview.ml
@@ -401,17 +401,16 @@ let tclFOCUSLIST l t =
else Some ((max i 1), (min j n))
in
let l = CList.map_filter sanitize l in
- (* Sort the list to get the left-most goal to focus. This goal won't
- move, and we will then place all the other goals to focus to the
- right. *)
- let l = CList.sort compare l in
match l with
| [] -> tclZERO (NoSuchGoals 0)
| (mi, _) :: _ ->
+ (* Get the left-most goal to focus. This goal won't move, and we
+ will then place all the other goals to focus to the right. *)
+ let mi = CList.fold_left (fun m (i, _) -> min m i) mi l in
(* [CList.goto] returns a zipper, so that
[(rev left) @ sub_right = comb]. *)
let left, sub_right = CList.goto (mi-1) comb in
- let p x _ = CList.exists (fun (i, j) -> i <= x +mi && x + mi <= j) l in
+ let p x _ = CList.exists (fun (i, j) -> i <= x + mi && x + mi <= j) l in
let sub, right = CList.partitioni p sub_right in
let mj = mi - 1 + CList.length sub in
Comb.set (CList.rev_append left (sub @ right)) >>