Repository navigation
[API Coherence] Report for 2026-10-16 - Solver, Array, Context/Config APIs #11194
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #11210. |
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
Analyzed: Solver APIs, Array theory APIs, Context/Config & global parameter APIs
Total C API functions checked: ~55 (Solver) + ~13 (Array) + ~14 (Context/Config)
Languages covered: C, C++, Python, .NET, Java, OCaml, Go, TypeScript, Rust (external crate)
Previously cached issues resolved: 0 (first run — no prior cache found)
Inconsistencies found: 5
Progress
High Priority Issues
1. Rust
z3crate: Solver API missing most advanced/introspection functionsWhat: The Rust high-level
Solverstruct (z3/src/solver.rs) only wraps a small subset ofZ3_solver_*functions:assert,assert_and_track,check,check_assumptions,check_and_get_model,from_string,get_assertions,get_consequences,get_model,get_proof,get_reason_unknown,get_statistics,get_unsat_core,new,new_for_logic,pop,push,reset,set_params,to_smt2.It is missing:
Z3_solver_get_num_scopes,Z3_solver_interrupt,Z3_solver_congruence_root/next/explain,Z3_solver_cube,Z3_solver_solve_for,Z3_solver_set_initial_value,Z3_solver_translate,Z3_solver_to_dimacs_string,Z3_solver_add_simplifier,Z3_solver_import_model_converter,Z3_solver_get_help,Z3_solver_get_param_descrs,Z3_solver_get_units,Z3_solver_get_non_units,Z3_solver_get_trail,Z3_solver_get_levels,Z3_solver_from_file.Available in: C, C++, Python, .NET, Java, Go, OCaml, TypeScript (all expose congruence closure, cube, solve_for, set_initial_value, translate, to_dimacs, add_simplifier, import_model_converter, num_scopes, interrupt)
Missing in: Rust (
prove-rs/z3.rs)Fix: Add corresponding safe wrappers in
z3/src/solver.rsfor the listedZ3_solver_*functions; the low-level bindings already exist inz3-sys.Priority: High — core functionality (num_scopes, interrupt) plus increasingly-used features (cube-and-conquer, congruence closure) are entirely unavailable to Rust users.
2. TypeScript high-level
Solvermissinghelp(),toDimacs(), andimportModelConverter()What:
Z3_solver_get_help,Z3_solver_to_dimacs_string, andZ3_solver_import_model_converterare not exposed on the TSSolverinterface (src/api/js/src/high-level/types.ts, lines 1050–1517). Notehelp()exists onFixedpoint(line 1703) but notSolver.Available in: C, C++, Python, .NET, Java, Go, OCaml
Missing in: TypeScript
Fix: Add
help(): string,toDimacs(includeNames?: boolean): string, andimportModelConverter(src: Solver<Name>): voidto theSolverinterface and its implementation inhigh-level.ts.Priority: High —
get_help/param_descrsparity is part of the common solver introspection surface already present in 7 other bindings.Medium Priority Issues
3. TypeScript array theory missing
ConstArray/K,ArrayExt,ArrayDefault,AsArray, andMapWhat:
src/api/js/src/high-level/high-level.tsexposesSelect,Store,isArraySort,isArray, and an internalisConstArrayhelper, but no public constructors forZ3_mk_const_array,Z3_mk_array_ext,Z3_mk_array_default,Z3_mk_as_array, orZ3_mk_map.Available in: C, C++, Python (
K,Map), .NET (MkConstArray,MkArrayExt,MkArrayDefault,MkMap,MkAsArray), Java (mkConstArray,mkArrayExt,mkArrayDefault,mkMap), Go (MkConstArray,MkArrayDefault,MkArrayExt,MkAsArray,MkMap), OCaml (mk_const_array,mk_array_ext,mk_map,mk_term_arrayfor default)Missing in: TypeScript
Fix: Add
K(domain, value)(const array),Array.ext(a, b),Array.default(a),Array.map(f, ...arrays), andasArray(funcDecl)wrappers inhigh-level.ts, mirroring the PythonK/Map/is_as_arrayAPI shape.Priority: Medium — core array reads/writes work in TS, but extensionality, default values, and array-from-function-decl are common idioms used in modeling and model-extraction code.
4. OCaml missing constructor for
Z3_mk_as_arrayWhat: OCaml exposes
is_as_arrayandget_as_array_func_decl(src/api/ml/z3.mliline 838 and implementation usage) to inspect array-as-function values, but has nomk_as_arraywrapper to construct one from aFuncDecl.func_decl.Available in: C (
Z3_mk_as_array), C++ (as_array), Python (is_as_array/implicit viaMap), .NET (MkAsArray), Java (array handling via Native), Go (MkAsArray)Missing in: OCaml (construction direction only; inspection direction is present)
Fix: Add
val mk_as_array : context -> FuncDecl.func_decl -> Expr.exprtoz3.mli/z3.ml, delegating toZ3native.mk_as_array.Priority: Medium — niche but useful for round-tripping function declarations into array values (e.g., when building models programmatically).
Low Priority Issues
5. Naming inconsistency: OCaml's
mk_term_arrayvs. other languages'array_default/ArrayDefaultWhat: OCaml names the wrapper for
Z3_mk_array_defaultasmk_term_array(src/api/ml/z3.mlline 796:let mk_term_array = Z3native.mk_array_default), which does not match the "default" terminology used everywhere else (C++array_default, JavamkArrayDefault, .NETMkArrayDefault, GoMkArrayDefault, Python implicitdefault()method).Available in: all languages, but only OCaml uses divergent naming
Fix: Add
mk_array_defaultas an alias (or rename with a deprecated alias for backward compatibility) to align naming conventions and reduce confusion for developers moving between language bindings.Priority: Low — purely a naming/discoverability issue, not a functional gap.
Verification Notes
All findings above were independently verified by direct inspection of the current repository source (
src/api/z3_api.h,src/api/c++/z3++.h,src/api/python/z3/z3.py,src/api/dotnet/*.cs,src/api/java/*.java,src/api/ml/z3.mli/.ml,src/api/go/*.go,src/api/js/src/high-level/*.ts) and of the external Rust crateprove-rs/z3.rs(commitffb47c0c2d30259836b93b7dfb01679c4eabbff5) via the GitHub API. No cached prior issues existed to re-verify (first run of this checker).Next Areas to Analyze
Z3_optimize_*) API family (partially touched here viaset_initial_valuecomparison)Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
github.comraw.githubusercontent.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
All reactions