Skip to content

Commit

Permalink
fix(BV): Properly set fully interpreted operators
Browse files Browse the repository at this point in the history
Alt-Ergo calls "fully interpreted" symbols that are fully internalized
in semantic values and do not need to be taken into consideration by the
CC(X) algorithm (see function `congruents` in `ccx.ml`).

(Note that `fully_interpreted` is only called for the Shostak theory
associated with the symbol according to `is_min_symb`.)

The BV theory incorrectly states that all its symbols are fully
interpreted, including `bv2nat`, `int2bv`, etc.; however, only `concat`,
`extract` and `bv2nat` are fully interpreted. This means that Alt-Ergo
never performs congruence closure for these functions, leading to missed
reasoning opportunities.
  • Loading branch information
bclement-ocp committed Mar 25, 2024
1 parent 6de2088 commit c71be56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/reasoners/bitv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,10 @@ module Shostak(X : ALIEN) = struct
let compare = compare_mine
end)
*)
let fully_interpreted _ = true
let fully_interpreted sb =
match sb with
| Sy.Op (Concat | Extract _ | BVnot) -> true
| _ -> false

let term_extract _ = None, false

Expand Down
3 changes: 3 additions & 0 deletions src/lib/reasoners/sig.mli
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ module type SHOSTAK = sig

val print : Format.formatter -> t -> unit

(** return true if the symbol is fully interpreted by the theory, i.e. it
is fully embedded into semantic values and does not need term-level
congruence *)
val fully_interpreted : Symbols.t -> bool

val abstract_selectors : t -> (r * r) list -> r * (r * r) list
Expand Down

0 comments on commit c71be56

Please sign in to comment.