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

Propagate equalities within int2bv #749

Closed
wants to merge 1 commit into from

Conversation

bclement-ocp
Copy link
Collaborator

This patch adds some reasoning support in bitv_rel for equalities and disequalities between int2bv terms. More specifically, when an equality or disequality (~ stands for either = or distinct):

(~ ((_ int2bv n) t) ((_ int2bv n) u))

is asserted, we also assert that t and u are congruent (resp. noncongruence) modulo 2^n, i.e.

(~ (mod (- t u) (pow 2 n)) 0)

This allows recovering some reasoning power involving bitvector terms containing int2bv, and in particular terms involving bitvector arithmetic (since bitvector arithmetic is currently implemented using int2bv).

This patch adds some reasoning support in bitv_rel for equalities and
disequalities between `int2bv` terms. More specifically, when an
equality or disequality (~ stands for either `=` or `distinct`):

  `(~ ((_ int2bv n) t) ((_ int2bv n) u))`

is asserted, we also assert that `t` and `u` are congruent (resp.
noncongruence) modulo `2^n`, i.e.

  `(~ (mod (- t u) (pow 2 n)) 0)`

This allows recovering some reasoning power involving bitvector terms
containing `int2bv`, and in particular terms involving bitvector
arithmetic (since bitvector arithmetic is currently implemented using
`int2bv`).
@bclement-ocp
Copy link
Collaborator Author

Draft because I need to re-run benches on this.

@bclement-ocp
Copy link
Collaborator Author

This is +40-0 on smtlib22/QF_BV. Not sure I want to nominate this for 2.5.0, it's nice to have but not necessary so we can postpone (but I had it laying around so might as well make the PR).

@bclement-ocp bclement-ocp marked this pull request as ready for review July 25, 2023 09:57
@Halbaroth Halbaroth added this to the 2.6.0 milestone Jul 25, 2023
@Halbaroth
Copy link
Collaborator

Let's postpone it.

@bclement-ocp
Copy link
Collaborator Author

Following my investigations for #474 and #801 I have a better understanding of the type of equalities we see in relations, and in its current instantiation, this is not a general solution and will only propagate int2bv equalities in very specific situations. An implementation that correctly propagates int2bv equalities in the general case will be more involved and requires additional work, closing for now and opening an issue instead.

@bclement-ocp bclement-ocp mentioned this pull request Sep 15, 2023
@bclement-ocp bclement-ocp deleted the bclement/bv2nat_rel branch March 20, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants