java-smt icon indicating copy to clipboard operation
java-smt copied to clipboard

(Re)enable floating point support in Bitwuzla

Open daniel-raffler opened this issue 1 year ago • 1 comments

This patch set is a backport of the floating point parts of https://github.com/sosy-lab/java-smt/pull/353

  • It adds a new (JNI) method BitwuzlaJNI.bitwuzla_term_value_get_real() that can be used to read-out floating point values from Bitwuzla. This is needed when building a model and has been an open issue so far (see https://github.com/bitwuzla/bitwuzla/discussions/76).
  • It also overrides the inverse method BitwuzlaJNI.bitwuzla_mk_fp_from_real(). This allows us to add support for more general input strings that use scientific notation (f.ex "1.5e-2" instead of "0.015").
  • A new method makeNumberImpl(Rational n,..) is added to AbstractFloatingPointFormulaManager as the handling of rationals needs to be overriden for Bitwuzla.
  • ~~Some of the floating point tests had to be disabled as Bitwuzla does not seem to support casting from float to bitvector (the other direction is possible).~~ We now use a workaround to cast from float to bitvector. See the discussion in https://github.com/bitwuzla/bitwuzla/discussions/103.

daniel-raffler avatar Feb 01 '24 05:02 daniel-raffler

I've opened a discussion about our remaining issue with floating point values in Bitwuzla: https://github.com/bitwuzla/bitwuzla/discussions/103

daniel-raffler avatar Feb 01 '24 19:02 daniel-raffler