[API Coherence] API Coherence Report - March 6, 2026: BitVector, Array, Quantifier & Simplifier APIs #8886
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-13T23:22:07.371Z.
|
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
APIs analyzed in this run:
Languages covered: Java, .NET (C#), C++, Python, TypeScript, OCaml, Go, Rust
Total functions checked: ~35 API families across 8 languages
Previously cached issues resolved: 10 ✅
Unresolved cached issues: 2
New issues found: 1
Progress Tracker
Resolution Updates 🎉
The following cached issues have been resolved since the last run (February 24, 2026):
✅ TypeScript API Improvements
✅ Java API Improvements
✅ Go API Improvements
✅ OCaml API Improvements
✅ Rust Low-Level API (z3-sys)
Note: All issues were re-verified against the current codebase before confirming resolution.
High Priority Issues
1. Rust (High-Level): Missing Simplifier API Entirely
What: The Rust
z3crate (high-level API) does not expose any Simplifier type or related APIsAvailable in: Java, .NET, C++, Python, TypeScript, Go, OCaml
Missing in: Rust (high-level
z3crate)Details:
Z3_mk_simplifier,Z3_solver_add_simplifier,Z3_simplifier_and_then, etc.z3-sys(low-level FFI) does have bindings to these C functionsz3crate atprove-rs/z3.rsdoes not expose anySimplifiertypeSimplifierstruct with methods likeAndThen(),UsingParams(), etc.Solvertype in Rust has noadd_simplifier()methodImpact: Users of the Rust high-level API cannot use Z3's simplification framework
Suggested Fix:
Simplifierstruct toz3/src/(similar toSolver,Optimize,Tactic)new(),and_then(),using_params(),get_help(), etc.Solver::add_simplifier(&mut self, simplifier: &Simplifier) -> &mut SelfmethodPriority: High - Simplifiers are a core feature for formula preprocessing
Files:
src/api/go/simplifier.go(lines 1-85)src/api/java/Simplifier.javasrc/api/dotnet/Simplifier.cssrc/api/z3_api.h(search forZ3_simplifier)prove-rs/z3.rsatz3-sys/src/lib.rsprove-rs/z3.rsatz3/src/(no simplifier module exists)Medium Priority Issues
2. Rust (High-Level): Solver Missing Several Advanced APIs
What: The Rust
z3crate'sSolvertype is missing multiple methods available in other languagesMissing methods:
to_dimacs()/to_dimacs_string()- Convert solver state to DIMACS formatinterrupt()- Interrupt a running solverregister_on_clause()- Register callback for learned clausesget_trail()- Get the solver's current trailcube()- Get a cube from the solvercongruence_root()/congruence_next()- Access congruence closure informationsolve_for()- Solve with respect to specific variablesset_initial_value()- Set initial values for variablesAvailable in: Python, Java, .NET, C++, Go (most have these)
Missing in: Rust (high-level
z3crate)Details:
Z3_solver_to_dimacs_string,Z3_solver_interrupt, etc.)z3-sysFFI bindings may be incomplete or missing some of thesez3crate definitely doesn't expose them on theSolvertypeImpact: Advanced solver features and debugging capabilities are unavailable to Rust users
Suggested Fix:
z3-syshas FFI bindings for all missing C API functionsSolverstruct inz3/src/solver.rscheck(),assert(), etc.Priority: Medium - These are advanced/debugging features, not core functionality
Files:
prove-rs/z3.rsatz3/src/solver.rssrc/api/go/solver.go(comprehensive implementation)src/api/python/z3/z3.py(search forSolverObjclass)Medium Priority Issues (Continued)
3. Rust (High-Level): Optimize Missing Several APIs
What: The Rust
z3crate'sOptimizetype is missing methods available in other languagesMissing methods:
from_file()/from_string()- Load constraints from file/stringget_reason_unknown()- Get reason when optimization result is unknownget_statistics()- Get optimization statisticsregister_model_eh()- Register model event handlerAvailable in: Python, Java, .NET, C++, Go, TypeScript
Missing in: Rust (high-level
z3crate)Priority: Medium - Useful for practical optimization workflows
Suggested Fix:
Optimizestruct inz3/src/optimize.rsz3-sysFiles:
prove-rs/z3.rsatz3/src/optimize.rssrc/api/js/src/high-level/high-level.ts(search forOptimizeImpl)src/api/go/optimize.goGood News: Full API Coherence Found ✅
The following API families showed excellent coherence across all 8 language bindings:
BitVector Operations ✅
All languages support:
sign_ext/zero_ext(sign/zero extension)extract(bit extraction)rotate_left/rotate_rightrepeatVerified in:
Context.mkSignExt(),Context.mkZeroExt(),Context.mkExtract(), etc.Context.MkSignExt(),Context.MkZeroExt(),Context.MkExtract(), etc.sext(),zext()functions inz3++.hSignExt(),ZeroExt(),Extract()functionssignExt(),zeroExt(),extract()methods onBitVecMkSignExt(),MkZeroExt(),MkExtract()methodsmk_sign_ext,mk_zero_ext,mk_extractfunctionssign_ext(),zero_ext(),extract()methods inz3/src/ast/bv.rsArray Theory ✅
All languages support:
select/store(basic array operations)const_array(constant arrays)array_ext(array extensionality witness)array_defaultVerified in all 8 languages including the relatively new
array_extAPI.Quantifiers & Lambda ✅
All languages support:
forall/exists(universal/existential quantification)lambda(lambda expressions/array definitions)mk_quantifier(with bound variables) andmk_quantifier_const(with constants)Verified in all 8 languages including both low-level and high-level Rust APIs.
Statistics
Recommendations
For Rust
z3Crate Maintainers (High Priority)The external Rust crate at
prove-rs/z3.rsshould add:Simplifier API (High Priority)
z3/src/simplifier.rsmoduleSimplifierstruct with constructor and combinator methodsSolver::add_simplifier()methodsrc/api/go/simplifier.goin this repoExtended Solver APIs (Medium Priority)
to_dimacs(),interrupt(),get_trail(),cube(), etc.src/api/go/solver.goor PythonSolverObjclassExtended Optimize APIs (Medium Priority)
from_file(),get_reason_unknown(),get_statistics(), etc.OptimizeImplor Gooptimize.goFor Z3 Repository Maintainers
Consider adding a cross-language API test suite that verifies:
Next Run Focus
For the next API coherence analysis run, I will analyze:
Z3_mk_fpa_*, rounding modes, FP operations)str.++,str.len,str.substr,seq.*, regex operations)mk_tactic,and_then,or_else,apply,probe)Z3_fixedpoint_*for Datalog-style queries)Methodology Notes
prove-rs/z3.rsto analyze Rust bindingssrc/api/z3_api.h(baseline C API), language-specific directories undersrc/api/, and external Rust repoDiscussion auto-closes: 90 days of inactivity (workflow configured)
Cache updated: March 6, 2026
Next scheduled run: Will analyze 3-5 new API families in the next execution
Beta Was this translation helpful? Give feedback.
All reactions