Commit f6f1be78 authored by POTTIER Francois's avatar POTTIER Francois

Renamed [UnionFind.find] to [UnionFind.get].

parent 20b4c0e3
......@@ -384,7 +384,7 @@ let () =
(* Define accessors. *)
let represented state =
UnionFind.find (represented state)
UnionFind.get (represented state)
let representeds states =
if Lr1.NodeSet.is_empty states then
......
......@@ -71,7 +71,7 @@ let var_name =
^ let d = !name_counter / 26 in if d = 0 then "" else string_of_int d
in
fun v ->
let repr = UnionFind.find v in
let repr = UnionFind.get v in
match repr.name with
None -> let name = next_name () in repr.name <- Some name; name
| Some x -> x
......@@ -111,7 +111,7 @@ let rec paren_nt_type colors = function
args^" -> *", true
and paren_var (white, black) x =
let descr = UnionFind.find x in
let descr = UnionFind.get x in
if Mark.same descr.mark white then begin
descr.mark <- black;
var_name x, false
......@@ -150,7 +150,7 @@ let dfs action x =
let black = Mark.fresh () in
let rec visit_var x =
let descr = UnionFind.find x in
let descr = UnionFind.get x in
if not (Mark.same descr.mark black) then begin
descr.mark <- black;
action x;
......@@ -191,7 +191,7 @@ exception BadArityError of int * int
let rec unify_var toplevel x y =
if not (UnionFind.equivalent x y) then
let reprx, repry = UnionFind.find x, UnionFind.find y in
let reprx, repry = UnionFind.get x, UnionFind.get y in
match reprx.structure, repry.structure with
None, Some _ -> occurs_check x y; UnionFind.union x y
| Some _, None -> occurs_check y x; UnionFind.union y x
......
......@@ -70,9 +70,9 @@ let rec repr point =
| Info _ ->
point
(** [find point] returns the descriptor associated with [point]'s
(** [get point] returns the descriptor associated with [point]'s
equivalence class. *)
let rec find point =
let rec get point =
(* By not calling [repr] immediately, we optimize the common cases
where the path starting at [point] has length 0 or 1, at the
......@@ -83,7 +83,7 @@ let rec find point =
| Link { link = Info info } ->
info.descriptor
| Link { link = Link _ } ->
find (repr point)
get (repr point)
let rec set point v =
match point.link with
......
......@@ -25,9 +25,9 @@ type 'a point
equivalence class of its own, whose descriptor is [desc]. *)
val fresh: 'a -> 'a point
(** [find point] returns the descriptor associated with [point]'s
(** [get point] returns the descriptor associated with [point]'s
equivalence class. *)
val find: 'a point -> 'a
val get: 'a point -> 'a
(** [union point1 point2] merges the equivalence classes associated
with [point1] and [point2] into a single class whose descriptor is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment