mirror of
https://github.com/c-cube/sidekick.git
synced 2026-01-22 17:36:41 -05:00
refactor(cc): disable path compression
This commit is contained in:
parent
1d212350ef
commit
6d2d1c91e8
1 changed files with 2 additions and 10 deletions
|
|
@ -78,20 +78,12 @@ let[@inline] size_ (r:repr) =
|
|||
Invariant: [in_cc t ∧ do_cc t => forall u subterm t, in_cc u] *)
|
||||
let[@inline] mem (cc:t) (t:term): bool = Term.Tbl.mem cc.tbl t
|
||||
|
||||
(* TODO: remove path compression, point to new root explicitely during `union` *)
|
||||
|
||||
(* find representative, recursively, and perform path compression *)
|
||||
(* find representative, recursively *)
|
||||
let rec find_rec cc (n:node) : repr =
|
||||
if n==n.n_root then (
|
||||
n
|
||||
) else (
|
||||
let old_root = n.n_root in
|
||||
let root = find_rec cc old_root in
|
||||
(* path compression *)
|
||||
if root != old_root then (
|
||||
on_backtrack cc (fun () -> n.n_root <- old_root);
|
||||
n.n_root <- root;
|
||||
);
|
||||
let root = find_rec cc n.n_root in
|
||||
root
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue