Skip to content

Commit

Permalink
fix(BV): Treat bvand, bvor, bvxor as interpreted (#1007)
Browse files Browse the repository at this point in the history
While they are not interpreted in the Shostak sense, they should still
be treated as interpreted symbols of the BV theory (in the same way as,
for instance, `**` is treated as an interpreted symbol of the Arith
theory even though it is actually not interepreted in the CC(X) sense).
  • Loading branch information
bclement-ocp authored Dec 11, 2023
1 parent 184ae9d commit f7ae6f7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/reasoners/bitv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ module Shostak(X : ALIEN) = struct

let is_mine_symb sy _ =
match sy with
| Sy.Bitv _ | Sy.Op (Concat | Extract _ | BV2Nat | BVnot) -> true
| Sy.Bitv _
| Op (Concat | Extract _ | BV2Nat | BVnot | BVand | BVor | BVxor)
-> true
| _ -> false

let embed r =
Expand Down Expand Up @@ -398,7 +400,12 @@ module Shostak(X : ALIEN) = struct
let (and+) = (and*)

let other ~neg t _sz ctx =
let r, ctx' = X.make t in
let r, ctx' =
match E.term_view t with
| { f = Op (BVand | BVor | BVxor); _ } ->
X.term_embed t, []
| _ -> X.make t
in
let ctx = List.rev_append ctx' ctx in
let bv = embed r in
if neg then negate_abstract bv, ctx else bv, ctx
Expand Down

0 comments on commit f7ae6f7

Please sign in to comment.