[API Coherence] Report for March 1, 2026 - BitVector, Array, Quantifier, Finite Set APIs #8823
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-08T23:20:25.205Z.
|
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.
-
Analysis Scope
🎉 Resolution Status: All 10 Cached Issues RESOLVED!
Great progress since February 24! All previously identified gaps have been addressed:
Resolved Issues:
toDimacs()- solver_to_dimacs_stringToDimacs()to_dimacsDimacs()translate()Translate()getProof()addSimplifier()AddSimplifier()registerOnClause()getLower(),getUpper(),fromFile(),unsatCore(),objectives(),reasonUnknown()These APIs are now consistently available across languages! Thank you to everyone who contributed to improving API coherence.
🔍 New Inconsistencies Found (9 issues)
HIGH PRIORITY (2 issues)
1. Rust: Missing Finite Set APIs entirely
What: Complete finite set theory (
Z3_mk_finite_set_*) is missing from Rust bindingsAvailable in: C, C++, Python, Java, .NET, TypeScript, OCaml, Go
Missing in: Rust (both
z3crate andz3-sys)Impact: Cannot work with finite sets in Rust - theory completely unavailable
Functions missing:
Z3_mk_finite_set_empty,_singleton,_union,_intersect,_differenceZ3_mk_finite_set_member,_size,_subsetZ3_mk_finite_set_map,_filterFix: Add finite set module to z3 crate (9 functions total)
Example (Python has this):
Verified: 2026-03-01
2. TypeScript, Go, Rust: Missing
Z3_mk_as_array(array from function)What: Cannot create array representation from function declaration
Available in: C, C++, Python, Java, .NET, OCaml
Missing in: TypeScript, Go, Rust
Impact: Limits array theory expressiveness - cannot get array representation of lambda/function
C API:
Z3_mk_as_array(context, func_decl) -> arrayExample use case (Python):
Fix: Add
as_array()method to FuncDecl or Array moduleVerified: 2026-03-01
MEDIUM PRIORITY (4 issues)
3. Python, Java, .NET: Missing BitVector Reduction Operators
What: Bitwise reduction operators
bvredand/bvredor(reduce all bits to single bit)Available in: C, C++, TypeScript, OCaml, Go, Rust
Missing in: Python, Java, .NET
Impact: Cannot express "all bits are 1" (redand) or "any bit is 1" (redor) idioms
C API:
Z3_mk_bvredand(c, bv),Z3_mk_bvredor(c, bv)Use case: Check if any/all bits are set in a bitvector
bvredor(x) == 1means "at least one bit in x is 1"bvredand(x) == 1means "all bits in x are 1"Fix:
BvRedAnd()andBvRedOr()functions in z3.pyredAnd()andredOr()methods toBitVecExprclassRedAnd()andRedOr()methods toBitVecExprclassVerified: 2026-03-01
4. Python, Java, .NET: Missing BitVector NAND/NOR/XNOR
What: Bitwise NAND, NOR, XNOR operators
Available in: C, C++, TypeScript, OCaml, Go, Rust
Missing in: Python, Java, .NET
Impact: Users must manually negate AND/OR/XOR - less idiomatic and less efficient
C API:
Z3_mk_bvnand,Z3_mk_bvnor,Z3_mk_bvxnorWorkaround (Python):
Fix:
BvNand(),BvNor(),BvXnor()functionsnand(),nor(),xnor()methods toBitVecExprNand(),Nor(),Xnor()methods toBitVecExprVerified: 2026-03-01
5. TypeScript: Missing Signed Multiply Overflow Check
What: TypeScript has
bvmul_no_overflowbut only for unsigned versionAvailable in: C (both signed/unsigned), C++, Python, Java, .NET, OCaml, Go, Rust
Missing in: TypeScript (missing signed version with
is_signed=true)Impact: Cannot check signed multiplication overflow in TypeScript
C API:
Z3_mk_bvmul_no_overflow(c, t1, t2, is_signed=true)Current TypeScript:
Fix: Add second parameter or separate method:
Verified: 2026-03-01
6. Go, OCaml: Missing Recursive Function Definitions
What: Cannot define recursive functions (
Z3_mk_rec_func_decl+Z3_add_rec_def)Available in: C, C++, Python, Java, .NET, TypeScript, Rust
Missing in: Go, OCaml
Impact: Cannot model recursive functions like factorial, fibonacci, tree traversals
C API:
Z3_mk_rec_func_decl,Z3_add_rec_defExample (Python has this):
Fix:
RecFunctype andMkRecFunc(),AddRecDef()methodsmk_rec_func_declandadd_rec_defbindingsVerified: 2026-03-01
LOW PRIORITY (3 issues)
7. TypeScript, Go, OCaml: Missing Model.translate()
What: Cannot translate models between contexts
Available in: C, C++, Python, Java, .NET, Rust
Missing in: TypeScript, Go, OCaml
Impact: Limits multi-context workflows where you need to move models between contexts
C API:
Z3_model_translateFix: Add
translate(target: Context)method to Model classVerified: 2026-03-01
8. OCaml: Missing
optimize_translateandsolver_cubein interfaceWhat: Functions exist in implementation (
.ml) but not in interface (.mli)Available in: Implementation file
z3.mlMissing in: Interface file
z3.mliImpact: Functions not accessible to OCaml users (not exported)
Fix: Add function signatures to
z3.mli:Verified: 2026-03-01
9. Rust: Missing Solver/Optimize translate()
What: Cannot translate solvers/optimizers between contexts in Rust
Available in: C, C++, Python, Java, .NET, TypeScript, Go, OCaml
Missing in: Rust (
z3crate high-level API)Impact: Multi-context solver workflows limited
C API:
Z3_solver_translate,Z3_optimize_translateNote:
z3-syshas the FFI binding butz3crate doesn't expose it in the high-level APIFix: Add
translate()methods toSolverandOptimizestructsVerified: 2026-03-01
📊 Statistics
🎯 Recommendations for Maintainers
Quick Wins (1-2 hours each):
z3-sysand wrap inz3cratebvredand/bvredorwrappers (2 lines each)z3.mliMedium Effort (3-6 hours each):
RecFunctype with CGO bindingsDocumentation Opportunity:
🔜 Next Run Preview
The next analysis will focus on:
Expected completion: ~50% of total API surface by next run.
Beta Was this translation helpful? Give feedback.
All reactions