[API Coherence] Run #2 - BitVector, Floating-Point, Array, Quantifier APIs #8811
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-07T23:18:38.187Z.
|
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
Run Date: February 28, 2026
Run Number: 2 of ongoing systematic analysis
APIs Analyzed This Run:
Statistics:
🎉 Resolved Issues (Since Last Run on Feb 24)
The following issues from the previous run have been resolved and are now closed:
High Priority - TypeScript Optimize API (2 issues)
✅ TypeScript Optimize getLower()/getUpper() - Can now retrieve optimization results
getLower()andgetUpper()methods insrc/api/js/src/high-level/high-level.ts:4838,4842✅ TypeScript Optimize missing fromFile/unsatCore/objectives/reasonUnknown() - Complete optimization API
src/api/js/src/high-level/high-level.tsMedium Priority - Solver APIs (6 issues)
✅ Java missing toDimacs()
toDimacs(boolean includeNames)insrc/api/java/Solver.java✅ Java missing addSimplifier()
addSimplifier(Simplifier simplifier)insrc/api/java/Solver.java✅ .NET missing ToDimacs()
ToDimacs(bool includeNames = true)insrc/api/dotnet/Solver.cs✅ TypeScript missing translate()
translate()method in TypeScript Solver class✅ TypeScript missing getProof()
getProof()method in TypeScript Solver class✅ Go missing Translate(), GetProof(), AddSimplifier()
src/api/go/solver.goMedium Priority - Optimize APIs (1 issue)
Translate(target *Context)insrc/api/go/optimize.goMedium Priority - On-Clause Callbacks (1 issue)
src/api/js/src/high-level/high-level.tsGreat progress! 8 issues resolved, showing active API development across Java, .NET, TypeScript, and Go bindings.
📊 Progress Tracker
🔴 Open Issues (Unresolved)
Medium Priority
1. Go: Missing 8 BitVector Overflow/Underflow Check Functions
NEW in this run
What's missing: BitVector arithmetic overflow/underflow predicates
Available in: C, C++, Python, Java, .NET, TypeScript, OCaml
Missing in: Go, Rust
Missing functions:
Z3_mk_bvadd_no_overflow- Check if addition overflowsZ3_mk_bvadd_no_underflow- Check if signed addition underflowsZ3_mk_bvsub_no_overflow- Check if subtraction overflowsZ3_mk_bvsub_no_underflow- Check if signed subtraction underflowsZ3_mk_bvsdiv_no_overflow- Check if signed division overflowsZ3_mk_bvneg_no_overflow- Check if negation overflowsZ3_mk_bvmul_no_overflow- Check if multiplication overflowsZ3_mk_bvmul_no_underflow- Check if signed multiplication underflowsC API reference:
src/api/z3_api.h:3172-3249Target file:
src/api/go/bitvec.goSuggested implementation (Go):
Why it matters: These predicates are essential for formal verification of arithmetic-heavy code, where detecting overflow/underflow bugs is critical for correctness and security.
2. Rust: Missing 8 BitVector Overflow/Underflow Check Functions
NEW in this run
Same functions as issue #1 above.
Target:
z3.rs/z3/src/(external repo: https://github.com/prove-rs/z3.rs)Dependency: Also requires FFI bindings in
z3-syscrate firstNote: This is an external repository. Consider opening an issue at https://github.com/prove-rs/z3.rs/issues
3. Go: Missing Z3_solver_to_dimacs_string
What's missing: Export solver constraints to DIMACS format (CNF)
Available in: Python, C++, Java, .NET, TypeScript, OCaml
Missing in: Go, Rust
C API:
Z3_solver_to_dimacs_string(c, s, include_names)Reference:
src/api/z3_api.hTarget file:
src/api/go/solver.goSuggested fix:
4. Rust: Missing Z3_solver_to_dimacs_string
Same as issue #3 above.
Target:
z3.rs/z3/src/solver.rs5. Rust: Missing Z3_solver_translate
What's missing: Translate solver from one context to another
Available in: Python, Java, .NET, C++, OCaml, TypeScript, Go
Missing in: Rust
C API:
Z3_solver_translate(source_ctx, s, target_ctx)Target:
z3.rs/z3/src/solver.rs6. Go, Java, Rust: Missing Z3_solver_register_on_clause
What's missing: Register callback for learned clauses during solving
Available in: Python, .NET, C++, OCaml, TypeScript
Missing in: Go, Java, Rust
C API:
Z3_solver_register_on_clause(c, s, user_context, on_clause_eh)Use case: Advanced SAT solver integration, incremental learning
Note: Requires language-specific callback infrastructure (function pointers, FFI closures)
7. TypeScript, OCaml, Rust: Missing Z3_optimize_translate
What's missing: Translate optimizer from one context to another
Available in: Python, Java, .NET, C++, Go
Missing in: TypeScript, OCaml, Rust
C API:
Z3_optimize_translate(source_ctx, o, target_ctx)8. Rust: Many Solver/Optimize APIs Missing
The Rust
z3crate is missing numerous APIs available in other high-level bindings:Solver APIs missing:
interrupt()- Interrupt ongoing solvecube()- Get cube (partial model)get_trail()- Get solver trailcongruence_*()- Congruence closure queriessolve_for()- Solve with specific variablesset_initial_value()- Provide initial value hintOptimize APIs missing:
translate()- Context translationNote: External repository at https://github.com/prove-rs/z3.rs. Many of these may require FFI additions in
z3-sysfirst.🟢 APIs With Good Coherence
The following API families showed excellent cross-language coherence with no significant gaps:
✅ Floating-Point APIs (81 functions)
All major FP operations well-covered across all languages:
Checked across: Python, Java, .NET, C++, TypeScript, Go, OCaml, Rust ✅
✅ Array Theory APIs (10 functions)
All major array operations well-covered:
mk_array_sort,mk_array_sort_n- Array type constructorsmk_select,mk_select_n- Array read (multi-dimensional)mk_store,mk_store_n- Array write (multi-dimensional)mk_const_array- Constant arraysmk_array_default- Get default valuemk_array_ext- Array extensionalitymk_as_array- Convert function to arrayChecked across: Python, Java, .NET, C++, TypeScript, Go, OCaml, Rust ✅
✅ Quantifier APIs (10 functions)
All major quantifier operations well-covered:
mk_forall,mk_forall_const- Universal quantificationmk_exists,mk_exists_const- Existential quantificationmk_lambda,mk_lambda_const- Lambda expressionsmk_quantifier,mk_quantifier_ex- Generic quantifier constructionmk_quantifier_const,mk_quantifier_const_ex- With bound constantsChecked across: Python, Java, .NET, C++, TypeScript, Go, OCaml ✅
📋 Methodology
Systematic Approach:
z3_api.h,z3_fpa.h)Languages Analyzed:
src/api/c++/z3++.h)src/api/python/z3/z3.py)src/api/java/*.java)src/api/dotnet/*.cs)src/api/js/src/high-level/)src/api/ml/*.ml,*.mli)src/api/go/*.go)github.com/prove-rs/z3.rs)🎯 Recommendations Priority
For Z3 maintainers:
High Impact:
Medium Impact:
2. Go BitVector overflow/underflow - Add 8 missing functions to
src/api/go/bitvec.goMkBVAdd,MkBVMulimplementationsExternal Coordination:
4. Rust bindings - Consider engaging with
prove-rs/z3.rsmaintainersz3-sysfirstLower Priority (Advanced Features):
5. registerOnClause callbacks - Missing in Go, Java, Rust
📌 Next Analysis Run
Planned for next run:
Z3_fixedpoint_*)Z3_mk_datatype, constructors, accessors)Z3_get_proof,Z3_proof_*)Z3_mk_tactic, combinators)Expected completion: Run #3 will bring us to ~50% coverage of the total API surface.
📝 Notes
github.com/prove-rs/z3.rs- issues noted but outside direct Z3 repo scopeAPI Coherence Checker - Automated systematic analysis
Run frequency: Weekly or on-demand
Questions? Comment below!
Beta Was this translation helpful? Give feedback.
All reactions