Skip to content

Commit

Permalink
let's pretend we support commutative operators
Browse files Browse the repository at this point in the history
  • Loading branch information
bclement-ocp committed Jul 24, 2024
1 parent d8a18fc commit 5ce9665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/lib/reasoners/rel_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,10 +1079,8 @@ struct
let nrr_nf = NF.normal_form nrr in
let nrrd = find_or_default nrr_nf t in
let nnrrd = D.intersect nrrd rrd in
let t =
if D.equal nnrrd rrd then t
else { t with triggers = W.Set.union ws t.triggers }
in
(* Always trigger to check for simplifications. *)
let t = { t with triggers = W.Set.union ws t.triggers } in
let t =
match nrr_nf with
| Constant _ -> t
Expand Down
8 changes: 6 additions & 2 deletions src/lib/structures/expr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3169,10 +3169,14 @@ module BV = struct
bvcomp (size2 s t) s t

(* Arithmetic operations *)
let bvadd s t = mk_term (Op BVadd) [s; t] (type_info s)
let bvadd s t =
let xs = List.sort compare [s; t] in
mk_term (Op BVadd) xs (type_info s)
let bvsub s t = mk_term (Op BVsub) [s; t] (type_info s)
let bvneg s = bvsub (of_bigint_like s Z.zero) s
let bvmul s t = mk_term (Op BVmul) [s; t] (type_info s)
let bvmul s t =
let xs = List.sort compare [s; t] in
mk_term (Op BVmul) xs (type_info s)
let bvudiv s t = mk_term (Op BVudiv) [s; t] (type_info s)
let bvurem s t = mk_term (Op BVurem) [s; t] (type_info s)
let bvsdiv s t =
Expand Down

0 comments on commit 5ce9665

Please sign in to comment.