Skip to content

Commit

Permalink
Filter out-of-invariant exclusion list elements in IntDomTuple invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Jun 19, 2024
1 parent 39f6c2d commit 06f8f4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cdomain/value/cdomains/intDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3803,6 +3803,8 @@ module IntDomTupleImpl = struct
let min = minimal x in
let max = maximal x in
let ns = Option.map fst (to_excl_list x) |? [] in
let ns = Option.map_default (fun min -> List.filter (Z.geq min) ns) ns min in
let ns = Option.map_default (fun max -> List.filter (Z.leq max) ns) ns max in
Invariant.(
IntInvariant.of_interval_opt e ik (min, max) &&
IntInvariant.of_excl_list e ik ns &&
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/witness/int.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
column: 5
function: main
location_invariant:
string: (51 <= i && i <= 99) && (i != 0 && (51 <= i && i <= 99))
string: (51 <= i && i <= 99) && (51 <= i && i <= 99)
type: assertion
format: C
- entry_type: location_invariant
Expand Down

0 comments on commit 06f8f4b

Please sign in to comment.