Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BV): Actually propagate freshness change #1011

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(BV): Actually propagate freshness change
The `Constraints` module has a mechanism to remember fresh constraints
that have never been propagated, so that we don't need to always
re-propagate constraints that have already been propagated if their
arguments have not changed. Unfortunately, we forget the change to this
set of fresh constraints, and hence always re-propagate all active
constraints, which renders the optimization useless.

This patch actually takes into consideration the changes to the set of
fresh constraints.
bclement-ocp committed Dec 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 62e5003ba2ac5ed3fa34f42069dba6e8456d1a37
6 changes: 3 additions & 3 deletions src/lib/reasoners/bitv_rel.ml
Original file line number Diff line number Diff line change
@@ -681,7 +681,7 @@ let propagate =
let changed, dom = propagate SX.empty bcs dom in
SX.fold (fun r acc ->
add_eqs acc (Shostak.Bitv.embed r) (Domains.get r dom)
) changed [], dom
) changed [], bcs, dom

type t =
{ delayed : Rel_utils.Delayed.t
@@ -741,7 +741,7 @@ let assume env uf la =
(env.congruence, (env.constraints, env.domain), env.size_splits)
la
in
let eqs, domain = propagate constraints domain in
let eqs, constraints, domain = propagate constraints domain in
if Options.get_debug_bitv () && not (Lists.is_empty eqs) then (
Printer.print_dbg
~module_name:"Bitv_rel" ~function_name:"assume"
@@ -816,7 +816,7 @@ let add env uf r t =
let dr = abstract_bitlist (Shostak.Bitv.embed r) Ex.empty in
let dom = Domains.update Ex.empty r env.domain dr in
let congruence = Congruence.add r env.congruence in
let eqs', dom = propagate bcs dom in
let eqs', bcs, dom = propagate bcs dom in
{ env with congruence ; constraints = bcs ; domain = dom },
List.rev_append eqs' eqs
with Bitlist.Inconsistent ex ->