prove-rs / z3.rs

Rust bindings for the Z3 solver.
337 stars 105 forks source link

No way to access the raw `Z3_sort` from `Sort<'ctx>` or `Z3_context` from `Context` #290

Closed Dessix closed 3 months ago

Dessix commented 4 months ago

Most functionality around Float types is unbound. Adding bindings without editing or forking this library is impossible without the extreme hack of declaring copies of the structs and transmuting references between them to trick Rust into accessing the private fields z3_sort or z3_ctx.

I was attempting to invoke z3_sys's Z3_mk_fpa_to_fp_real, but it requires raw access to the Z3_sort values, as well as a rounding mode, but functions like z3_sys::Z3_mk_fpa_rne require an instance of the raw Z3_context, which lack a high-level wrapper.