Skip to content

Conversation

@bclement-ocp
Copy link
Collaborator

The bv2nat mapping is able to record an integer expression for each bit-vector extraction, but we only need to record arithmetic right shifts since we encode an extraction bv<i, j> as (bv asr j) - (bv asr i) * 2^(j - i + 1).

This ensures we can't accidentally leave bogus extractions in the map.

@bclement-ocp bclement-ocp force-pushed the bclement/bv2nat-asr branch 8 times, most recently from cad7edd to 9bc2300 Compare September 9, 2025 14:26
And add it to the lockfile, so that the workflows that use a lock file
can build (:
To simplify review of the next commit.
The bv2nat mapping is able to record an integer expression for each
bit-vector extraction, but we only need to record arithmetic right
shifts since we encode an extraction `bv<i, j>` as `(bv asr j) - (bv asr
i) * 2^(j - i + 1)`.

This ensures we can't accidentally leave bogus extractions in the map.

(* Add the equality [nat_r = bv2nat(bv_r)]. *)
let add_bv2nat ~ex nat_r bv_r t =
match BitvNormalForm.normal_form bv_r with
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation of this change? If I understand well, you replace the normal form of Bitv_rel by the normal form of Bitv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants