-
Notifications
You must be signed in to change notification settings - Fork 33
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
BV primitives #625
Comments
Regarding the 3rd point, I am not sure we want to do this, at least for 2.5.0 I believe going through the canonizer allows to avoid work in some complex cases; for instance consider Note that we don't avoid all the work required to parse the |
From what I understand of the code, the |
Ah, right, the canonizer AST currently does not record information about the size of the vectors. The way I see it, there are two ways we can do these simplifications:
I have a slight preference for 1. (partly because we can rely on the compiler a bit more for pattern matching exhaustiveness), which is the current approach with the canonizer, but I'd be fine with 3. 2 I think is problematic because it can have adverse effect on triggers (it can break syntactic triggers, and we are not well equipped for that, see e.g. the issues we had with arith simplifications). I think you are more or less doing 3. already from a quick skim of the current state of the PR, so maybe we can get rid of the canonizer at the same time in that case. |
I see you have checked " Support for the all the SMT-LIB2 Bit-Vector primitives" does that mean that #669 is ready for review? |
I guess the task is not specific enough, does support all the BV primitives of the SMT-LIB? Yes |
I think it's fine to go step by step and have the non-expanded version of bv2nat first then expand it in another PR (I prefer smaller PRs personally), but if you want to do it all in one go it's OK as well; I thought that PR was specifically for the 1st task which is why I asked. Ideally removing the canonizer should be in a separate PR, unless it is needed for the rest. If it's not needed for the rest, I am also not convinced we want that 3rd task for 2.5.0, it's not part of our engagements (it's an implementation detail) and we are already late for the release. |
It's not needed for the rest, I guess we can review this one then. |
To clarify, I am not against including it in 2.5.0 if it happens to be ready on time, but it should not block/slow down PRs that do need to be in 2.5.0 |
This patch adds support for the negation (bvnot) operator in the bitvector solver. There are two components to this support: - First, the union-find data structure used by the solver is replaced with an actual union-find data structure implemented using Tarjan's efficient algorithm, rather than using an implementation with sets and maps. - Second, the new union-find data structure is augmented with a link between a class representative and the representative of its negated class. When merging two classes, their negated classes are merged as well (and, in particular, if a class gets forced to all ones or all zeroes, its negated classes gets forced to the other bit value). If a class is ever merged with its negated class, the problem is unsolvable. The implementation is not necessarily the most efficient (e.g. we iterate over lists to negate them rather than directly creating the negated variables at several points), but it should be fairly simple and requires few changes to the existing solver infrastructure. The performance can be improved later if necessary. This extracted and simplified from part OCamlPro#669 and works towards better support for OCamlPro#625.
Doc update is tracked in part of #648 |
Add support for the SMT-LIB2 Bit-Vector primitives.
Features:
bv2nat
(maybenat2bv
too?) right awayThe text was updated successfully, but these errors were encountered: