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

Float binding issues #291

Open
5 tasks
Dessix opened this issue May 5, 2024 · 1 comment
Open
5 tasks

Float binding issues #291

Dessix opened this issue May 5, 2024 · 1 comment

Comments

@Dessix
Copy link

Dessix commented May 5, 2024

The high-level library provides limited Float support, but what is present seems to be below the minimum necessary to make use of float sorts.

  • The bindings do not expose a means of retrieving a float value from a solved Float Ast.
  • Floats cannot be displayed as their human-readable value, instead displaying hex forms of the raw sign, exponent, and mantissa bits. While these values can technically be extracted and reparsed to bypass the first limitation, this is unlikely to be the library's intended solution.
  • There is no provided way to convert Floats to and from Real values or expose necessary RoundingMode functionality to implement such Real conversions in a useful manner.
  • Binding missing Float behaviour as a library consumer is heavily limited by No way to access the raw Z3_sort from Sort<'ctx> or Z3_context from Context #290, which also limits attempts at improvements which could eventually be integrated into the library if they prove useful.
  • Z3_mk_fpa_mul is bound incorrectly, as may be other trinops; It is supposed to receive mul(ctx, roundingMode, fpAst, fpAst), but is instead receiving mul(ctx, fpAst, fpAst, fpAst), which causes floats to always hit the is_null assertion during the mul invocation; This appears to be untested.
@dragazo
Copy link
Contributor

dragazo commented Jul 23, 2024

I think the first point is possible with Float::as_f64 on the result of Model::eval provided with a Float.

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

No branches or pull requests

2 participants