Commit f31f206a authored by fpottier's avatar fpottier

Replaced & with && in Patricia.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/menhir@343 0f8b5475-4b4e-0410-85a8-ee3154a6bfe7
parent 1d7ca028
......@@ -372,7 +372,7 @@ module Make (X : Endianness.S) = struct
fine_add decide key value s
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then
if (p = q) && (m = n) then
(* The trees have the same prefix. Merge their sub-trees. *)
......@@ -381,7 +381,7 @@ module Make (X : Endianness.S) = struct
if t0 == u0 && t1 == u1 then t
else Branch(p, m, u0, u1)
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
(* [q] contains [p]. Merge [t] with a sub-tree of [s]. *)
......@@ -390,7 +390,7 @@ module Make (X : Endianness.S) = struct
else
Branch(p, m, s0, union s1 t)
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
(* [p] contains [q]. Merge [s] with a sub-tree of [t]. *)
......@@ -500,7 +500,7 @@ module Make (X : Endianness.S) = struct
| Branch (p, m, tree0, tree1) ->
let tree0' = endo_map f tree0 in
let tree1' = endo_map f tree1 in
if (tree0' == tree0) & (tree1' == tree1) then
if (tree0' == tree0) && (tree1' == tree1) then
tree
else
Branch (p, m, tree0', tree1')
......@@ -730,7 +730,7 @@ module Domain = struct
add x s
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then
if (p = q) && (m = n) then
(* The trees have the same prefix. Merge their sub-trees. *)
......@@ -739,7 +739,7 @@ module Domain = struct
if t0 == u0 && t1 == u1 then t
else Branch(p, m, u0, u1)
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
(* [q] contains [p]. Merge [t] with a sub-tree of [s]. *)
......@@ -748,7 +748,7 @@ module Domain = struct
else
Branch(p, m, s0, union s1 t)
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
(* [p] contains [q]. Merge [s] with a sub-tree of [t]. *)
......@@ -801,13 +801,13 @@ module Domain = struct
remove x s
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then
if (p = q) && (m = n) then
(* The trees have the same prefix. Compute the differences of their sub-trees. *)
build p m (diff s0 t0) (diff s1 t1)
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
(* [q] contains [p]. Subtract [t] off a sub-tree of [s]. *)
......@@ -816,7 +816,7 @@ module Domain = struct
else
build p m s0 (diff s1 t)
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
(* [p] contains [q]. Subtract a sub-tree of [t] off [s]. *)
......@@ -842,19 +842,19 @@ module Domain = struct
if mem x t then s else Empty
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then
if (p = q) && (m = n) then
(* The trees have the same prefix. Compute the intersections of their sub-trees. *)
build p m (inter s0 t0) (inter s1 t1)
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
(* [q] contains [p]. Intersect [t] with a sub-tree of [s]. *)
inter (if (q land m) = 0 then s0 else s1) t
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
(* [p] contains [q]. Intersect [s] with a sub-tree of [t]. *)
......@@ -888,13 +888,13 @@ module Domain = struct
raise NotDisjoint
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then begin
if (p = q) && (m = n) then begin
inter s0 t0;
inter s1 t1
end
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
inter (if (q land m) = 0 then s0 else s1) t
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
inter s (if (p land n) = 0 then t0 else t1)
else
() in
......@@ -1045,13 +1045,13 @@ module Domain = struct
| Branch(p, m, s0, s1), Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then begin
if (p = q) && (m = n) then begin
diff s0 t0;
diff s1 t1
end
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
diff s (if (p land n) = 0 then t0 else t1)
......@@ -1160,18 +1160,18 @@ end
remove k s
| Branch(p, m, s0, s1), Domain.Branch(q, n, t0, t1) ->
if (p = q) & (m = n) then
if (p = q) && (m = n) then
build p m (corestrict s0 t0) (corestrict s1 t1)
else if (X.shorter m n) & (match_prefix q p m) then
else if (X.shorter m n) && (match_prefix q p m) then
if (q land m) = 0 then
build p m (corestrict s0 t) s1
else
build p m s0 (corestrict s1 t)
else if (X.shorter n m) & (match_prefix p q n) then
else if (X.shorter n m) && (match_prefix p q n) then
corestrict s (if (p land n) = 0 then t0 else t1)
......
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