[API Coherence] Report for 2026-06-08 – Verification Run + Type Variable & Polymorphic Datatype APIs #9761
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #9786. |
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
This run re-verified all 8 previously cached issues (all confirmed still open) and investigated three additional API families.
Resolution Updates
No previously cached issues have been resolved since the last run (2026-06-07). All 8 issues were re-verified as still open in the current codebase (Z3Prover/z3 at
59bb444, prove-rs/z3.rs cloned fresh on 2026-06-08).Progress
z3_api.hfor newly added C API functions; monitor prove-rs/z3.rs for Rust improvementsHigh Priority Issues
1. Rust Missing Simplifier API
What: The Rust high-level
z3crate has noSimplifiertype and noSolver::add_simplifier()method. The low-levelz3-syscrate exposes the full C FFI, but it is not wrapped.Available in: C, C++ (
simplifierclass,solver.add_simplifier()), Python (SimplifierRef,Solver.add_simplifier()), Java (Simplifier,Solver.addSimplifier()), .NET (Simplifier,Solver.AddSimplifier()), TypeScript/JS, OCaml, GoMissing in: Rust high-level
z3crate (z3/src/)Suggested fix: Add a
Simplifier<'ctx>struct toz3/src/simplifier.rswrappingZ3_simplifier, withand_then()andusing_params()combinators, and aSolver::add_simplifier()method.Priority: High
2. Rust Missing FiniteSet API (also missing from z3-sys FFI layer)
What:
z3-sysdoes not exposeZ3_mk_finite_set_sort,Z3_mk_finite_set_empty,Z3_mk_finite_set_singleton,Z3_mk_finite_set_union,Z3_mk_finite_set_inter,Z3_mk_finite_set_subset,Z3_mk_finite_set_member,Z3_mk_finite_set_complement,Z3_mk_set_to_finite_set, orZ3_mk_finite_set_of_seq. (Note:Z3_mk_finite_domain_sortis an unrelated API.) The high-levelz3crate therefore has no FiniteSet support at all.Available in: C (
z3_api.h), C++ (finite_set_sort(), set operations onexpr), Python (FiniteSetSort,EmptySet,FullSet,SetUnion, etc.), Java, .NET, TypeScript/JS, OCaml (FiniteSetmodule), Go (finiteset.go)Missing in: Both
z3-sys(FFI layer) andz3(high-level) crates in prove-rs/z3.rsSuggested fix: Add all
Z3_mk_finite_set_*functions toz3-sys/src/, then add aFiniteSet<'ctx>type and set operation methods to the high-levelz3crate.Priority: High (entire API family missing from FFI layer)
3. Rust Missing Polymorphic Datatype Support (new this run)
What: The Rust high-level
z3crate'sDatatypeBuilderonly supports monomorphic datatypes.z3-sysexposesZ3_mk_type_variableandZ3_mk_polymorphic_datatype, but the high-level crate has no API to create type variable sorts or polymorphic datatypes with type parameters.Available in: C, C++ (
context::datatype(name, params, constructors)), Python (CreatePolymorphicDatatype()), Java (Context.mkPolymorphicDatatypeSort()), .NET (Context.MkPolymorphicDatatypeSort()), TypeScript/JS (Datatype.createPolymorphicDatatype()), OCaml (Datatype.mk_polymorphic_sort), Go (Context.MkPolymorphicDatatypeSort())Missing in: Rust high-level
z3crate (z3/src/lib.rs—DatatypeBuilderhas no type-parameter support)Suggested fix: Add
Context::type_variable(name: &str) -> Sort<'ctx>wrappingZ3_mk_type_variable, and extendDatatypeBuilder(or add aPolymorphicDatatypeBuilder) to accept type parameter sorts and callZ3_mk_polymorphic_datatype.Priority: High (needed for any recursive generic data structure)
Medium Priority Issues
4. OCaml and Go Missing Polynomial Subresultants API
What:
Z3_polynomial_subresultants(ctx, p, q, x)(insrc/api/z3_polynomial.h) is not exposed in OCaml (src/api/ml/) or Go (src/api/go/).Available in: C, C++ (
polynomial_subresultants()), Python (PolynomialSubresultants()), Java, .NET, TypeScript/JS, Rust (z3-sys)Missing in: OCaml, Go
Suggested fix (OCaml): Add
val polynomial_subresultants : context -> Expr.expr -> Expr.expr -> Expr.expr -> Expr.expr listtosrc/api/ml/z3.mlandz3.mli.Suggested fix (Go): Create
src/api/go/polynomial.gowithfunc (c *Context) PolynomialSubresultants(p, q, x *Expr) []*Expr.Priority: Medium
5. Go Missing
MkFreshConst/MkFreshFuncDeclWhat: The Go API has no wrappers for
Z3_mk_fresh_constorZ3_mk_fresh_func_decl, which create uniquely-named constants and function declarations.Available in: C, C++ (
context::fresh_const(),context::fresh_func_decl()), Python (FreshConst(),FreshFunction()), Java, .NET, TypeScript/JS, OCaml, Rust (z3-sys)Missing in: Go (
src/api/go/)Suggested fix: Add
func (c *Context) MkFreshConst(prefix string, sort *Sort) *Exprandfunc (c *Context) MkFreshFuncDecl(prefix string, domain []*Sort, range_ *Sort) *FuncDecltosrc/api/go/z3.go.Priority: Medium
6. Go and Rust Missing
EnableTrace/DisableTraceWhat: Go exposes
OpenLog,CloseLog,AppendLogbut notEnableTrace/DisableTrace. The Rust high-levelz3crate exposes no logging or tracing wrappers at all (only inz3-sys).Available in: C, C++ (
enable_trace(),disable_trace()), Python, Java (Global.enableTrace()), .NET (Global.EnableTrace()), TypeScript/JS, OCaml (Log.enable_trace)Missing in: Go (
src/api/go/log.go— trace wrappers absent), Rust high-levelz3crateSuggested fix (Go): Add
func EnableTrace(tag string)andfunc DisableTrace(tag string)tosrc/api/go/log.go.Suggested fix (Rust): Add
fn enable_trace(tag: &str),fn disable_trace(tag: &str),fn open_log(path: &str) -> bool,fn close_log()as free functions inz3/src/log.rs.Priority: Medium
7. Simplifier Enumeration API Missing in C++, Python, TypeScript/JS, Go, Rust
What:
Z3_get_num_simplifiers(ctx),Z3_get_simplifier_name(ctx, i), andZ3_simplifier_get_descr(ctx, name)allow enumerating all available simplifiers. Present in .NET, Java, OCaml; absent elsewhere.Available in: .NET (
Context.NumSimplifiers,Context.SimplifierNames,Context.SimplifierDescription()), Java (Context.getNumSimplifiers(), etc.), OCaml (Context.get_num_simplifiers, etc.)Missing in: C++ (
z3++.h), Python (z3.py), TypeScript/JS, Go (src/api/go/simplifier.go), Rust high-levelz3crateSuggested fix (C++): Add
unsigned num_simplifiers(),symbol simplifier_name(unsigned i), andstd::string simplifier_description(char const* name)to thecontextclass.Suggested fix (Python): Add
num_simplifiers(),simplifier_names(), andsimplifier_description(name)as free functions inz3.py.Priority: Medium (tooling / documentation quality)
8. C++ and Rust Missing
mk_type_variableWrapper (new this run)What:
Z3_mk_type_variablecreates a sort acting as a type parameter for polymorphic datatypes. C++ has nocontext::type_variable()wrapper — the C++ example (examples/c++/example.cpp:1016) callsZ3_mk_type_variabledirectly. Rust high-levelz3crate similarly lacks a wrapper (thoughz3-syshas the FFI binding).Available in: Java (
Context.mkTypeVariable()), .NET (Context.MkTypeVariable()), Python (TypeVarRef/Z3_mk_type_variable), TypeScript/JS (Context.TypeVariable()), OCaml (Sort.mk_type_variable,Sort.mk_type_variable_s), Go (Context.MkTypeVariable())Missing in: C++ (
z3++.h— nocontext::type_variable()method), Rust high-levelz3crateSuggested fix (C++):
Suggested fix (Rust): Add
Context::type_variable<'ctx>(&'ctx self, name: &str) -> Sort<'ctx>inz3/src/.Priority: Medium (required to use polymorphic datatypes without raw C API calls)
Low Priority Issues
9. .NET Missing
MkLinearOrder,MkPiecewiseLinearOrder,MkTreeOrderWhat: .NET exposes only
MkPartialOrderandMkTransitiveClosurefrom the Special Relations API. Three of the five relations are missing.Available in: C, C++ (
linear_order(),piecewise_linear_order(),tree_order()), Python, Java, TypeScript/JS, OCaml, Go, Rust (z3-sys)Missing in: .NET (
src/api/dotnet/Context.cs)Suggested fix: Add
MkLinearOrder(Sort a, uint index),MkPiecewiseLinearOrder(Sort a, uint index),MkTreeOrder(Sort a, uint index)toContext.cs.Priority: Low
10. Go Missing
AST.Id()MethodWhat: Go's
ASTstruct hasHash()(wrappingZ3_get_ast_hash) but lacksId()(wrappingZ3_get_ast_id).Available in: All other languages
Missing in: Go (
src/api/go/z3.go)Suggested fix: Add
func (a *AST) Id() uint { return uint(C.Z3_get_ast_id(a.ctx.ptr, a.ptr)) }.Priority: Low
Methodology
All issues were verified against:
Z3Prover/z3at commit59bb444prove-rs/z3.rscloned fresh on 2026-06-08No issues were found to have been resolved since the last run on 2026-06-07.
Beta Was this translation helpful? Give feedback.
All reactions