[API Coherence] Report for March 9, 2026 - BitVector, FPA, and Array APIs #8915
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-16T23:34:37.460Z.
|
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
Analyzed: BitVector operations, Floating-point APIs, Array theory APIs
Total functions checked: ~60+
Languages covered: 8 (Python, Java, .NET, C++, TypeScript, Go, OCaml, Rust)
Previously cached issues resolved: 8/10 (80%)
New issues found: 0 (excellent API coverage across all languages)
Issues still open: 2 (both Rust-specific)
Progress
APIs analyzed so far: ~65/~200 (32.5%)
Resolution Updates
The following cached issues have been resolved since the last run on February 24, 2026:
✅ 1. Java Solver - DIMACS Export (Resolved)
Previously reported:
Z3_solver_to_dimacs_stringmissing in JavaStatus: ✅ Fixed - Java
Solver.javanow hastoDimacs(boolean includeNames)method (line 587)✅ 2. TypeScript Solver - Translate (Resolved)
Previously reported:
Z3_solver_translatemissing in TypeScriptStatus: ✅ Fixed - TypeScript now has
translate(target: Context)method inhigh-level.ts(line 2155)✅ 3. Rust Solver - Translate (Resolved)
Previously reported:
Z3_solver_translatemissing in RustStatus: ✅ Fixed - Rust now has
translate(&self, dest: &Context)implementation viaTranslatetrait (line 627)✅ 4. TypeScript Solver - Get Proof (Resolved)
Previously reported:
Z3_solver_get_proofmissing in TypeScriptStatus: ✅ Fixed - TypeScript now has proof retrieval in
high-level.ts(line 2161)✅ 5. Go Solver - Get Proof (Resolved)
Previously reported:
Z3_solver_get_proofmissing in GoStatus: ✅ Fixed - Go
solver.gonow hasGetProof()method (line 372)✅ 6. Java Solver - Add Simplifier (Resolved)
Previously reported:
Z3_solver_add_simplifiermissing in JavaStatus: ✅ Fixed - Java
Solver.javanow hasaddSimplifier(Simplifier)method (line 575)✅ 7. TypeScript Solver - Add Simplifier (Resolved)
Previously reported:
Z3_solver_add_simplifiermissing in TypeScriptStatus: ✅ Fixed - TypeScript now has
addSimplifier(simplifier: Simplifier)method (line 2072)✅ 8. TypeScript Optimize - Complete API (Resolved)
Previously reported: TypeScript Optimize missing
getLower(),getUpper(),unsatCore(),objectives(),reasonUnknown(),fromFile(),translate()Status: ✅ All Fixed - TypeScript
OptimizeImplclass now has all these methods:getLower(index: number)(line 2388)getUpper(index: number)(line 2392)unsatCore()(line 2396)objectives()(line 2400)reasonUnknown()(line 2404)fromFile(filename: string)(line 2408)translate(target: Context)(line 2413)Current Analysis: BitVector, FPA, and Array APIs
BitVector Operations ✅
Analyzed 15+ core operations: sign extension, zero extension, rotate left/right, overflow/underflow checking (add, sub, mul, div, neg)
Result: ✅ Excellent coverage across all languages
SignExt(),ZeroExt(),RotateLeft(), etc.)mkSignExt(),mkZeroExt(),mkRotateLeft(), etc.)MkSignExt(),MkZeroExt(),MkBVRotateLeft(), etc.)rotate_left(),sext(),zext())signExt(),zeroExt(),rotateLeft(),rotateRight(),addNoOverflow(), etc.)MkSignExt(),MkZeroExt(),MkBVRotateLeft(),MkBVAddNoOverflow(), etc.)mk_sign_ext,mk_zero_ext,mk_rotate_left,mk_add_no_overflow, etc.)sign_ext(),zero_ext(),bvrotl(),bvrotr(),bvadd_no_overflow(), etc.)All languages provide:
Floating-Point APIs ✅
Analyzed 40+ operations: sort creation, arithmetic (add, sub, mul, div, sqrt, fma), comparisons, conversions (toIEEEBV, toReal, toSBV, toUBV), predicates (isNaN, isInfinite, isNormal, etc.)
Result: ✅ Excellent coverage across all languages
FPRef,FPNumRef,FPSortRef,FPRMRefFPExpr,FPNum,FPSort,FPRMExprFPExpr,FPNum,FPSort,FPRMExprfpa_sort(),fpa_const(),fpa_val(), member predicatesFP,FPNum,FPSort,FPRM(conversion-focused)MkFPAdd(),MkFPMul(),MkFPSqrt(), etc.)mk_fpa_add,mk_fpa_sqrt, predicates)Floattype with arithmetic methods and rounding mode supportAll languages provide:
Array Theory APIs ✅
Analyzed 7 core operations: select, store, const_array, array_default, map, as_array, array_ext
Result: ✅ Excellent coverage across all languages
Select(),Store(),Map(),AsArray(), etc.)mkSelect(),mkStore(),mkConstArray(),mkMap(),mkAsArray(),mkArrayExt())z3++.hAll languages provide:
select)store)const_array)map)as_array)array_ext)High Priority Issues
1. Rust z3-sys Missing FFI Bindings for 25 Solver Functions
What: Rust
z3-syscrate (low-level FFI bindings) only exposes 28 out of 53Z3_solver_*C API functions (~53% coverage)Missing functions (25 total):
Z3_solver_add_simplifierZ3_solver_interruptZ3_solver_register_on_clauseZ3_solver_to_dimacs_stringZ3_solver_get_trailZ3_solver_congruence_root,Z3_solver_congruence_next,Z3_solver_congruence_explainZ3_solver_solve_for,Z3_solver_set_initial_valueZ3_solver_get_levelsZ3_solver_propagate_*functions (user propagator API)Z3_solver_callback,Z3_solver_next_splitImpact:
z3crate cannot expose these features without FFI bindingsAvailable in: C, Python, Java, C#, C++, TypeScript, Go, OCaml
Missing in: Rust (z3-sys FFI layer)
Priority: High - These are not exotic features; simplifiers and interruption are commonly used in production solvers
Suggested fix:
z3-sys/src/lib.rsz3_api.hto prevent future driftz3crate for the newly exposed functions2. Rust High-Level Solver API Missing Several Methods
What: Rust high-level
Solverclass inz3crate missing methods that exist in other language bindingsMissing methods:
interrupt()- Cancel ongoingcheck()operationcube()- Get cube representationget_trail()- Get current decision trailcongruence_root(),congruence_next()- Congruence closure inspectionsolve_for()- Solve with assumptions for subset of variablesset_initial_value()- Provide initial values for searchregister_on_clause()- Register callback for learned clausesto_dimacs()- Export to DIMACS formatAvailable in: Python, Java, C#, C++, TypeScript, Go, OCaml
Missing in: Rust (high-level
z3crate)Root cause: Most of these are missing because the underlying FFI bindings don't exist in
z3-sys(see issue #1)Priority: High - These methods are used in advanced SMT applications
Suggested fix:
/tmp/z3.rs/z3/src/solver.rsMedium Priority Issues
None identified. The analysis of BitVector, FPA, and Array APIs revealed excellent API coherence. All 8 languages provide comprehensive, well-designed bindings for these critical theories.
Low Priority Issues
None identified.
Statistics
Coverage by Language
toDimacs,addSimplifier)Resolution Rate
Key insight: The Z3 team has been very active in improving API coherence! TypeScript and Java received significant updates between runs.
Recommendations
Immediate Actions (Rust Team)
Add missing FFI bindings to z3-sys (Priority: High)
Z3_solver_add_simplifier,Z3_solver_interrupt,Z3_solver_register_on_clause,Z3_solver_to_dimacs_stringz3_api.hto prevent future drift/tmp/z3.rs/z3-sys/src/lib.rsAdd high-level Rust wrappers (Priority: High)
interrupt(),to_dimacs(),register_on_clause()methods onSolver/tmp/z3.rs/z3/src/solver.rsDocument Rust API gaps (Priority: Medium)
prove-rs/z3.rsrepositoryStrategic Recommendations
Maintain the excellent coherence achieved - The recent improvements to TypeScript and Java show great attention to API consistency
Consider Rust as a first-class language - Rust is increasingly popular for verification tools and SMT solver integration
Automate coherence checking - Consider adding CI checks that compare API surface area across languages
Next Run Focus
Planned API families for next analysis:
Z3_mk_forall,Z3_mk_exists,Z3_mk_lambda, patterns)Z3_fixedpoint_*)Z3_mk_datatype, constructors, accessors)Z3_tactic_*, combinators)Z3_mk_params,Z3_params_set_*)Estimated next completion: ~50-55% of total API surface analyzed
Beta Was this translation helpful? Give feedback.
All reactions