Skip to content

Commit 8af2e49

Browse files
For elements in the same bucket, perform meet
1 parent 3fcb562 commit 8af2e49

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

src/cdomain/value/cdomains/addressDomain.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ struct
110110
| StrPtr _, UnknownPtr -> None
111111
| _, _ -> Some false
112112

113-
let amenable_to_meet x y = match x,y with
114-
| StrPtr _, StrPtr _ -> true
115-
| Addr x, Addr y when Mval.equal (Mval.top_indices x) (Mval.top_indices y) -> true
116-
| _ -> false
117-
118113
let leq x y = match x, y with
119114
| StrPtr s1, StrPtr s2 -> SD.leq s1 s2
120115
| Addr x, Addr y -> Mval.leq x y
@@ -183,7 +178,6 @@ struct
183178
struct
184179
include SetDomain.Joined (Addr)
185180
let may_be_equal a b = Option.value (Addr.semantic_equal a b) ~default:true
186-
let amenable_to_meet = Addr.amenable_to_meet
187181
end
188182
module OffsetSplit = DisjointDomain.ProjectiveSetPairwiseMeet (Addr) (J) (Addr.UnitOffsetRepr)
189183

src/cdomain/value/cdomains/addressDomain_intf.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ sig
8282
(** Check semantic equality of two addresses.
8383
8484
@return [Some true] if definitely equal, [Some false] if definitely not equal, [None] if unknown. *)
85-
86-
val amenable_to_meet: t -> t -> bool
87-
(** Whether two addresses are amenable to meet operation, i.e., their lattice meet overapproximates the intersection
88-
of concretizations. If true, meet is used instead of semantic_equal *)
8985
end
9086

9187
(** Address lattice with sublattice representatives for {!DisjointDomain}. *)

src/domain/disjointDomain.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ module type MayEqualSetDomain =
182182
sig
183183
include SetDomain.S
184184
val may_be_equal: elt -> elt -> bool
185-
val amenable_to_meet: elt -> elt -> bool
186185
end
187186

188187
module ProjectiveSetPairwiseMeet (E: Lattice.S) (B: MayEqualSetDomain with type elt = E.t) (R: Representative with type elt = E.t): SetDomain.S with type elt = E.t = struct
@@ -192,15 +191,16 @@ module ProjectiveSetPairwiseMeet (E: Lattice.S) (B: MayEqualSetDomain with type
192191
let meet_buckets b1 b2 acc =
193192
B.fold (fun e1 acc ->
194193
B.fold (fun e2 acc ->
195-
if B.amenable_to_meet e1 e2 then
194+
(* If they have the same representative, we use the normal meet within this bucket *)
195+
if R.equal (R.of_elt e1) (R.of_elt e2) then
196196
try
197197
let m = E.meet e1 e2 in
198198
if not (E.is_bot m) then
199199
add m acc
200200
else
201201
acc
202202
with Lattice.Uncomparable ->
203-
failwith (GobPretty.sprintf "amenable_to_meet %a %a returned true, but meet throws!" E.pretty e1 E.pretty e2)
203+
failwith (GobPretty.sprintf "Elements %a and %a are in same bucket, but meet throws!" E.pretty e1 E.pretty e2)
204204
else if B.may_be_equal e1 e2 then
205205
add e1 (add e2 acc)
206206
else

0 commit comments

Comments
 (0)