Repository navigation
[API Coherence] Report for 2026-10-18 - Solver & BitVector APIs #11214
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #11225. |
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 2 API families: Solver APIs (core, excluding advanced user-propagator/congruence functions) and BitVector APIs (arithmetic/overflow predicates, conversions, rotate/extend operations), across all 8 supported bindings (Java, .NET, C++, Python, TypeScript, OCaml, Go, Rust).
Note on Rust: The sandbox for this run has no network/DNS access, so
git clone https://github.com/prove-rs/z3.rsfailed (Could not resolve host: github.com). Rust coverage could not be verified this run and is not included in the findings below to avoid reporting speculative/unverified gaps. This should be re-attempted in a future run with network access.Confirmed Issues
1. C++
solverclass lacksnum_scopes()andhelp()wrapper methodsWhat's missing: The C API functions
Z3_solver_get_num_scopesandZ3_solver_get_helphave no corresponding method in the C++solverclass.Where it's implemented: Java (
getNumScopes/getHelp), .NET (NumScopes/Helpproperties), Python (num_scopes,help()), OCaml (get_num_scopes,get_help), Go (NumScopes(),GetHelp()), TypeScript (numScopesgetter — confirmed present).Where it's missing: C++ (
src/api/c++/z3++.h, classsolver, lines ~3078-3400). Notably, sibling classestactic,simplifier,optimize, andfixedpointin the same file do have ahelp()method (e.g. lines 3468, 3544, 3771, 3823), making the omission insolveran inconsistency even within the C++ API itself.Suggested fix: Add to the
solverclass insrc/api/c++/z3++.h:Priority: Medium (discoverability/parity issue; functionality is reachable only via raw
Z3_solver_get_num_scopes(ctx(), solver)C calls today)2. .NET
Solverclass lacksSolveFor(wrapsZ3_solver_solve_for)What's missing: No
SolveFormethod/overload exists inSolver.cs.Where it's implemented: Java (
Solver.solveFor,src/api/java/Solver.java:523), C++ (solver::solve_for,z3++.h), Python (solve_for), OCaml (solve_for), Go (Solver.SolveFor,src/api/go/solver.go:331), TypeScript (solveFor,high-level.ts:2322).Where it's missing: .NET (
src/api/dotnet/Solver.cs— verified via grep across all.csfiles insrc/api/dotnet/, no match forSolveFororZ3_solver_solve_for).Suggested fix: Add to
src/api/dotnet/Solver.cs, mirroring the Java/Go pattern:Priority: Medium (useful feature for symbolic elimination/solving; present in 6 of 8 bindings already)
3. Go bindings lack
Z3_mk_bv2intandZ3_mk_int2bvwrappers entirelyWhat's missing: No wrapper for converting between bit-vectors and integers (
Z3_mk_bv2int/Z3_mk_int2bv) exists anywhere insrc/api/go/*.go.Where it's implemented: Java (
mkBV2Int,Context.java:1742), C++ (bv2int,z3++.h:2466), Python (BV2Int,z3.py:4150), TypeScript (mk_bv2int/toInt(),high-level.ts:1583), OCaml, .NET (MkBV2Int/MkInt2BV, standard inContext.cs).Where it's missing: Go (
src/api/go/bitvec.go— verified via case-insensitive grep across the entiresrc/api/go/directory tree, zero matches forbv2intorint2bvin any form).Suggested fix: Add to
src/api/go/bitvec.go:Priority: High (this is a fundamental, commonly-used conversion function present in every other binding; its total absence in Go is a significant functional gap, not just a naming inconsistency)
Verified as Consistent (no action needed)
assert,assert_and_track,check,check_assumptions,cube,from_file,from_string,get_assertions,get_consequences,get_model,get_param_descrs,get_proof,get_reason_unknown,get_statistics,get_unsat_core,push,pop,reset,set_initial_value,set_params,to_dimacs_string,to_string,translate— present and functionally equivalent across all 7 verified bindings (TypeScript confirmed to havecube,fromFile,getConsequences,setInitialValue,solveFor,paramDescrscontrary to an initial unverified sub-agent pass — corrected after direct grep verification).bvadd_no_overflow,bvadd_no_underflow,bvsub_no_overflow,bvsub_no_underflow,bvmul_no_overflow,bvmul_no_underflow,bvsdiv_no_overflow,bvneg_no_overflow) — present in all 7 verified bindings including Java (mkBVAddNoOverflowetc., naming differs in case only).rotate_left,rotate_right,ext_rotate_left/right,sign_ext,zero_ext) — present and consistent across Java, .NET, Go, and others checked.Z3_solver_interruptexists in Java, Python, Go, and OCaml as a method on the Solver object; .NET, C++, and TypeScript only expose the context-levelZ3_interrupt(which per its own documentation "can be used to interrupt: solvers, simplifiers and tactics" and is explicitly recommended overZ3_solver_interruptin the OCaml docs comment: "Normally you should use Z3_interrupt to cancel solvers because only [solver-local interrupt applies to features] that are not selected for interrupts are left alone"). This is an intentional design choice, not a bug — not reported as an issue.Progress
Methodology Note
An initial exploratory sub-agent pass without network access produced several false positives for TypeScript (claiming
cube,fromFile,getConsequences,setInitialValue,solveFor,getParamDescrswere missing). All of these were directly re-verified by grep againstsrc/api/js/src/high-level/high-level.tsandtypes.tsand found to be present and correctly implemented. They are excluded from this report. This underscores the importance of direct verification over sub-agent inference for this task.Warning
Firewall blocked 4 domains
The following domains were blocked by the firewall during workflow execution:
crates.iodocs.rsgithub.compypi.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
All reactions