[API Coherence] Report for March 4, 2026 - BitVector, Floating-point, and Array Theory APIs #8861
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-11T23:25:52.360Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This run analyzed BitVector operations, Floating-point APIs, and Array theory APIs, building on the previous analysis of Solver and Optimize APIs from February 24, 2026.
Run Statistics
Progress Tracker
Resolution Updates
The following cached issues from the February 24 run have been resolved and are no longer present in the codebase:
✅ Resolved Issues
TypeScript Optimize getLower()/getUpper() - RESOLVED
getLower(index: number)andgetUpper(index: number)methods in the Optimize class (lines 2388-2392 of high-level.ts)TypeScript Optimize missing fromFile(), unsatCore(), objectives(), reasonUnknown() - RESOLVED
fromFile(filename: string)- line 2409unsatCore()- line 2396objectives()- line 2400-2401reasonUnknown()- line 2404Java Solver.addSimplifier() - RESOLVED
public Solver addSimplifier(Simplifier simplifier)at line 575 of Solver.javaGo Solver.toDimacsString() - RESOLVED
toDimacsString(includeNames bool)at line 398 of solver.goTypeScript Optimize.translate() - RESOLVED
translate(target: Context)method at lines 2413-2414High Priority Issues (New)
1. Go Missing BitVector Rotation and Repeat Operations
What: Go API lacks BitVector rotation and repeat operations
Available in: Python, Java, .NET, C++, OCaml, TypeScript
Missing in: Go
C API functions:
Z3_mk_rotate_left,Z3_mk_rotate_right,Z3_mk_ext_rotate_left,Z3_mk_ext_rotate_right,Z3_mk_repeatImpact: High - These are common operations for cryptographic and hardware verification use cases
Suggested fix: Add the following methods to
bitvec.go:RotateLeft(n uint) *ASTRotateRight(n uint) *ASTExtRotateLeft(e *AST) *ASTExtRotateRight(e *AST) *ASTRepeat(n uint) *ASTFiles to modify:
src/api/go/bitvec.goVerified: 2026-03-04
2. Go Missing Floating-point Operations
What: Go API lacks FPA fused multiply-add (fma), round_to_integral, and to_sbv/to_ubv conversions
Available in: Python, Java, .NET, C++, OCaml
Missing in: Go
C API functions:
Z3_mk_fpa_fma,Z3_mk_fpa_round_to_integral,Z3_mk_fpa_to_sbv,Z3_mk_fpa_to_ubvImpact: High - FMA is important for accurate floating-point computations; conversions are needed for mixed arithmetic
Suggested fix: Add the following methods to
fp.go:FMA(rm, x, y *AST) *AST- Fused multiply-addRoundToIntegral(rm *AST) *AST- Round to integer valueToSBV(rm *AST, sz uint) *AST- Convert to signed bit-vectorToUBV(rm *AST, sz uint) *AST- Convert to unsigned bit-vectorFiles to modify:
src/api/go/fp.goVerified: 2026-03-04
Medium Priority Issues (New)
3. Java Missing FPA to_sbv and to_ubv Conversions
What: Java lacks floating-point to signed/unsigned bit-vector conversions
Available in: Python, .NET, C++, OCaml
Missing in: Java, TypeScript, Go, Rust
C API functions:
Z3_mk_fpa_to_sbv,Z3_mk_fpa_to_ubvSuggested fix: Add methods to
Context.java:Files to modify:
src/api/java/Context.javaVerified: 2026-03-04
4. TypeScript Missing FPA round_to_integral
What: TypeScript lacks floating-point round-to-integral operation
Available in: Python, Java, .NET, C++, OCaml
Missing in: TypeScript, Go
C API function:
Z3_mk_fpa_round_to_integralSuggested fix: Add method to high-level Float class in TypeScript:
Files to modify:
src/api/js/src/high-level/high-level.tsVerified: 2026-03-04
5. C# Missing MkAsArray Function
What: C# can check if an expression is an as-array (via
IsAsArrayproperty) but cannot create oneAvailable in: Python, Java, C++, OCaml, TypeScript, Go
Missing in: .NET
C API function:
Z3_mk_as_arrayNote: C# has
IsAsArrayproperty to check but noMkAsArrayto createSuggested fix: Add method to
Context.cs:Files to modify:
src/api/dotnet/Context.csVerified: 2026-03-04
6. Rust High-level API Missing BitVector Manipulation Methods
What: Rust z3-sys has FFI bindings for BitVector operations, but the high-level z3 crate doesn't expose them
Available in: Python, Java, .NET, C++, OCaml, TypeScript, Go (partially)
Missing in: Rust (high-level z3 crate)
Note: z3-sys has the FFI bindings (
Z3_mk_concat,Z3_mk_extract,Z3_mk_rotate_*) but the high-level API doesn't expose themImpact: Medium - Rust users must use unsafe FFI calls directly
Suggested fix: Add methods to the
BVstruct in the z3 crate:concat(&self, other: &BV) -> BVextract(&self, high: u32, low: u32) -> BVrotate_left(&self, i: u32) -> BVrotate_right(&self, i: u32) -> BVrepeat(&self, i: u32) -> BVExternal repository: https://github.com/prove-rs/z3.rs
Verified: 2026-03-04
Low Priority Issues (New)
7. TypeScript and Go Missing Array Map Function
What: TypeScript and Go lack the array map function (apply function to array elements)
Available in: Python, Java, .NET, C++, OCaml
Missing in: TypeScript, Go
C API function:
Z3_mk_mapSuggested fix:
map(f: FuncDecl, ...arrays: Array)methodMap(f *FuncDecl, arrays ...*AST) *ASTfunctionFiles to modify:
src/api/js/src/high-level/high-level.ts,src/api/go/array.goVerified: 2026-03-04
Medium Priority Issues (Continuing from Previous Run)
The following issues from the February 24 run remain unresolved (updated with current status):
8. Z3_solver_to_dimacs_string - Partial Coverage
Available in: Python, C++, TypeScript, Go ✅
Missing in: Java, .NET, OCaml, Rust
Verified: 2026-03-04
9. Z3_solver_translate - Limited Coverage
Available in: Python, Java, .NET, C++, OCaml, TypeScript
Missing in: Go, Rust
Verified: 2026-03-04
10. Z3_solver_get_proof - Limited Coverage
Available in: Python, Java, .NET, C++, OCaml, Rust
Missing in: TypeScript, Go
Verified: 2026-03-04
11. Z3_solver_add_simplifier - Good Coverage
Available in: Python, .NET, C++, OCaml, TypeScript, Java ✅
Missing in: Go, Rust
Verified: 2026-03-04
12. Z3_solver_register_on_clause - Very Limited Coverage
Available in: Python, .NET, C++
Missing in: TypeScript, Go, Java, OCaml, Rust
Verified: 2026-03-04
13. Z3_optimize_translate - Good Coverage
Available in: Python, Java, .NET, C++, TypeScript ✅
Missing in: OCaml, Go, Rust
Verified: 2026-03-04
14. Rust z3 Crate - Many Missing Solver/Optimize APIs
Missing: cube, trail, congruence, solve_for, set_initial_value, from_file, dimacs
Note: This is the high-level Rust crate (external repository: https://github.com/prove-rs/z3.rs)
Verified: 2026-03-04
15. Rust z3-sys - Missing FFI Bindings
Priority: Low (affects external crate maintainers, not Z3Prover/z3 directly)
Missing FFI bindings for: solver_to_dimacs_string, solver_add_simplifier, solver_register_on_clause, solver_congruence_*, solver_solve_for, solver_set_initial_value
Note: This is the low-level FFI crate (external repository: https://github.com/prove-rs/z3.rs)
Verified: 2026-03-04
Implementation Guidance for Maintainers
For Go API (Issues #1, #2, #7)
The Go API is missing several important operations across three API families. Recommended approach:
src/api/go/bitvec.gofollowing the pattern of existing operations likeExtractandConcatsrc/api/go/fp.gosrc/api/go/array.goAll C API functions are already implemented, so this is purely adding Go wrappers.
For Java API (Issue #3)
Add
mkFPToSBVandmkFPToUBVmethods toContext.java. The C API functions exist (Z3_mk_fpa_to_sbv,Z3_mk_fpa_to_ubv), and the native bindings should already be in place.For TypeScript API (Issues #4, #7)
roundToIntegralmethod to the Float classmapfunction for arraysBoth are straightforward additions following existing patterns in
high-level.ts.For C# API (Issue #5)
Add
MkAsArraymethod toContext.cs. Note that theIsAsArrayproperty already exists inExpr.cs, so the infrastructure is in place.For Rust (Issues #6, #14, #15)
Note: The Rust bindings are maintained in an external repository (https://github.com/prove-rs/z3.rs). These findings should be shared with that project's maintainers.
The high-level z3 crate would benefit from exposing more BitVector manipulation methods and Solver/Optimize APIs that are already available in z3-sys.
Next Steps
The next run will analyze one or more of:
Methodology
This analysis:
Discussion
Feedback and corrections welcome! If any of these findings are incorrect or if there are specific API families you'd like prioritized in the next run, please comment below.
Beta Was this translation helpful? Give feedback.
All reactions