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

Add basic support for the SMT-LIB BV and QF_BV logics #730

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

bclement-ocp
Copy link
Collaborator

This is the first part in a reloaded version of #669. It only includes parsing and typechecking support for the bit-vector primitives: bvnot, bvand, bvor, bv2nat and nat2bv (called int2bv because it also accepts negative inputs) are treated as uninterpreted functions; the other operators defined in the SMT-LIB are defined in terms of these primitives and of the existing concat and extract operators.

The support for the bit-vector functions will be improved in separate PRs focusing on the bv2nat/nat2bv interaction, so that we are at least able to solve simple arithmetic goals. In the future, we might want to consider additional strategies (e.g. bitblasting), but that is out of scope for now.

Following the discussion in #669, including the apparent restrictions around the building of "ite" in the theory and the lack of infrastructure for actually doing simplifications there (at least for now), the definition of most functions are moved back to Expr.ml. The PR also includes a few helper functions to help write the definition of the bitvector operators more concisely, which should help ensuring that they are correct.

@bclement-ocp bclement-ocp force-pushed the bclement/bv2 branch 2 times, most recently from cd4704d to 17820c9 Compare July 11, 2023 09:29
This is the first part in a reloaded version of OCamlPro#669.  It only includes
parsing and typechecking support for the bit-vector primitives: bvnot,
bvand, bvor, bv2nat and nat2bv (called int2bv because it also accepts
negative inputs) are treated as uninterpreted functions; the other
operators defined in the SMT-LIB are defined in terms of these
primitives and of the existing `concat` and `extract` operators.

The support for the bit-vector functions will be improved in separate
PRs focusing on the bv2nat/nat2bv interaction, so that we are at least
able to solve simple arithmetic goals. In the future, we might want to
consider additional strategies (e.g. bitblasting), but that is out of
scope for now.

Following the discussion in OCamlPro#669, including the apparent restrictions
around the building of "ite" in the theory and the lack of
infrastructure for actually doing simplifications there (at least for
now), the definition of most functions are moved back to `Expr.ml`. The
PR also includes a few helper functions to help write the definition of
the bitvector operators more concisely, which should help ensuring that
they are correct.
@bclement-ocp
Copy link
Collaborator Author

I had mixed up < and <= for integers — it should be good now.

@bclement-ocp
Copy link
Collaborator Author

This is +3295 on QF_BV just by being able to parse some otherwise trivial benches. There are 54 errors, all of which are stack overflows while typing (similar to #669, iirc).

@bclement-ocp bclement-ocp merged commit 47e623c into OCamlPro:next Jul 12, 2023
10 checks passed
@bclement-ocp bclement-ocp deleted the bclement/bv2 branch January 3, 2024 14:54
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