Repository navigation
[API Coherence] Report for 2026-10-10 - Solver, BitVector, Optimize APIs #11131
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #11135. |
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
First run of the API Coherence Checker. Analyzed: Solver APIs, BitVector operations, Optimize APIs.
Total C API functions checked: ~95 (across the three families)
Languages covered: Python, Java, .NET (C#), C++, TypeScript/JS, OCaml, Go (Rust not checked this run — see note below)
Previously cached issues resolved: N/A (first run)
Inconsistencies found: 2 confirmed
Note on Rust: cloning
prove-rs/z3.rsfailed in this sandbox (network access to github.com was blocked, HTTP 403 on CONNECT tunnel). Rust coverage could not be verified this run and is deferred.Progress
High Priority Issues
1. Missing BitVector ↔ Integer conversion in Go bindings
What's missing:
Z3_mk_bv2int(bitvector-to-integer) andZ3_mk_int2bv(integer-to-bitvector) have no Go wrappers.Where it's implemented: C, C++ (
z3++.h), Python (z3.py), Java (Context.java/Expr.java), .NET (Context.cs/Expr.cs), OCaml (z3.ml/.mli), TypeScript/JS (high-level.ts).Where it's missing: Go (
src/api/go/*.go— checkedbitvec.goand the fullsrc/api/godirectory; noBv2Int/Int2BVwrapper exists anywhere).Suggested fix: Add
func (c *Context) MkBV2Int(t *Expr, isSigned bool) *Exprandfunc (c *Context) MkInt2BV(n uint, t *Expr) *Exprtosrc/api/go/bitvec.go, following the existing pattern used forMkSignExt/MkZeroExtin the same file.Priority: High — this is a core, commonly used conversion function between the Int and BitVector theories, present in every other binding.
Verified: Checked current codebase (main branch) on 2026-10-10 — confirmed still missing in Go.
Medium Priority Issues
2. Missing
Optimize.Translate(context migration) in Java and .NETWhat's missing:
Z3_optimize_translate, which migrates anOptimizeobject to anotherZ3_context, has no high-level wrapper.Where it's implemented: Python (
z3.py,Optimize.translate), C++ (z3++.h), Go (optimize.go), OCaml (z3.ml/.mli), TypeScript/JS (high-level.ts/types.ts).Where it's missing: Java (
src/api/java/Optimize.java— hasgetHelp,Assert,AssertAndTrack,AssertSoft,Check,Push/Pop,getModel,getUnsatCore,MkMaximize/MkMinimize, bounds accessors,fromFile/fromString,getAssertions,getObjectives,setInitialValue,getStatistics— but notranslate), .NET (src/api/dotnet/Optimize.cs—Solver.cshasTranslate, butOptimize.csdoes not).Suggested fix:
public Optimize translate(Context target)toOptimize.javacallingNative.optimizeTranslate, mirroring Python'sOptimize.translate.public Optimize Translate(Context ctx)toOptimize.cs, mirroring the existingSolver.TranslateinSolver.cs(line ~591).Priority: Medium — useful for multi-threaded/parallel solving workflows that move
Optimizestate across contexts, but less commonly used than core conversions.Verified: Checked current codebase (main branch) on 2026-10-10 — confirmed still missing in both Java and .NET.
Low Priority Issues
None identified this run beyond the above.
Areas Checked With No Issues Found
push/pop/check/assert/get_model/get_unsat_core/get_statistics): consistent across all 7 bindings checked.cube,congruence_root/next/explain,solve_for,to_dimacs_string,register_on_clause,from_string,get_trail,get_non_units): consistent across all bindings checked.bvadd_no_overflow,bvsub_no_overflow,bvsdiv_no_overflow,bvneg_no_overflow,bvmul_no_overflow/no_underflow, etc.): consistent across Python, Java, .NET, C++, Go, OCaml, JS.ext_rotate_left/right,sign_ext,zero_ext,array_ext): consistent across all bindings checked.assert_soft,maximize/minimize, bounds as vectors,from_file,get_objectives,get_help): consistent across Python, Java, .NET, C++, Go, OCaml, JS.Next Steps
Future runs will analyze: Array theory APIs, Floating-point APIs, Datatype/Tuple construction APIs, Quantifier APIs (patterns, bound variables), and Model/ModelEval APIs. The Rust crate (
prove-rs/z3.rs) should be re-attempted when network access is available, as it could not be cloned in this sandboxed run (403 on GitHub CONNECT tunnel).Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
All reactions