Repository navigation
[API Coherence] Report for 2026-10-09 - Solver, BitVector, Array APIs #11125
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #11131. |
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
APIs analyzed this run: Solver core APIs, BitVector operations, Array theory APIs
Functions checked: ~56 solver functions, ~49 bitvector functions, ~9 array functions (114 total)
Languages covered: C (baseline), Java, .NET (C#), C++, Python, TypeScript/JS, OCaml, Go, Rust (external
z3crate)Previously cached issues resolved: 0 (first run — no prior cache found)
Inconsistencies found: 4 (all involving the external Rust crate)
This is the first run of the API Coherence Checker. A cache-memory tracking file has been initialized for future incremental runs.
Key Finding
The 7 in-tree language bindings (Java, .NET, C++, Python, TypeScript/JS, OCaml, Go) are highly coherent for Solver core, BitVector, and Array theory APIs — no gaps found among them. All inconsistencies identified in this run are between the in-tree bindings and the external Rust crate (
prove-rs/z3.rs), which wraps a much smaller surface of the C API for these families.High Priority Issues
1. Rust
Solveris missing most advanced solver operationsWhat's missing: The Rust crate's
Solverstruct (z3/src/solver.rs) only implements:new,from_string,new_for_logic,assert,assert_and_track,reset,check,check_assumptions,get_assertions,get_unsat_core,get_consequences,push,pop,get_model,get_proof,get_reason_unknown,set_params,get_statistics,to_smt2.It lacks wrappers for:
cube(),get_levels(),get_trail(),congruence_explain/next/root(), user-propagator registration (register_on_clause,propagate_*),get_help(),get_param_descrs(),interrupt(),get_num_scopes(),get_non_units()/get_units(),solve_for(),to_dimacs_string(),import_model_converter(),from_file(),next_split(),add_simplifier(),set_initial_value().Available in: Java, Python, .NET, C++, OCaml, Go (all expose most or all of these via
Z3_solver_*C API wrappers)Missing in: Rust (
z3crate)Suggested fix: Prioritize adding
interrupt(),get_num_scopes(),get_help()/get_param_descrs(), andto_dimacs_string()first (commonly used for debugging/tooling); propagator/congruence APIs are more specialized and lower priority within this group.File:
prove-rs/z3.rs→z3/src/solver.rsVerified: Checked current
mainbranch content on 2026-10-09 via GitHub API — confirmed missing.Medium Priority Issues
2. Rust
Arrayis missingZ3_mk_map(array-valued function application)What's missing:
Z3_mk_maplets you apply a function pointwise over one or more arrays (distinct fromZ3_mk_seq_mapused for sequences). No equivalent exists on Rust'sArraytype.Available in: Java (
Context.mkMap), Python (z3.Map), .NET (Context.MkMap), OCaml (Z3.Z3Array.mk_map), Go (Context.MkMapinarray.go), C API (Z3_mk_map)Missing in: Rust (
z3crate), and also C++ (z3++.honly has sequencemap, not arraymap) and TypeScript/JS high-level APISuggested fix: Add
Array::map(f: &FuncDecl, args: &[&Array]) -> Arraytoprove-rs/z3.rs'sz3/src/ast/array.rs. Separately, consider adding arraymapto C++ and JS bindings (noted for completeness, lower priority since this is a 3-language gap rather than Rust-only).File:
prove-rs/z3.rs→z3/src/ast/array.rs;src/api/c++/z3++.h;src/api/js/src/high-level/Verified: Checked current codebase/upstream content on 2026-10-09 — confirmed missing in all three.
Low Priority Issues
3. Rust
Arrayis missingstore_n(n-ary store, used with lambdas)What's missing:
Z3_mk_store_nhas no Rust wrapper. The RustArraytype only hasselect_n(n-ary read) but not the corresponding n-ary write.Available in: Java, Python, .NET, C++, OCaml, Go
Missing in: Rust (
z3crate)Suggested fix: Add
Array::store_n(&self, idxs: &[&dyn Ast], value: &dyn Ast) -> Selfmirroring the existingselect_nimplementation style.File:
prove-rs/z3.rs→z3/src/ast/array.rsVerified: Checked current content on 2026-10-09 — confirmed missing.
4. Rust
Arrayis missingarray_defaultandarray_extWhat's missing:
Z3_mk_array_default(default value of a finite-domain array) andZ3_mk_array_ext(extensionality witness index) have no Rust equivalents.Available in: Java, Python, .NET, C++, OCaml, Go
Missing in: Rust (
z3crate)Suggested fix: Add
Array::default(&self) -> Dynamicand a free function or associated method forarray_ext(two-array extensionality witness).File:
prove-rs/z3.rs→z3/src/ast/array.rsVerified: Checked current content on 2026-10-09 — confirmed missing.
Progress
Z3_optimize_*) APIsNotes on Methodology
prove-rs/z3.rs) could not begit cloned directly from this sandbox (network egress blocked), so its source was retrieved via the GitHub API (solver.rs,ast/array.rs, directory listings ofz3/srcandz3-sys/src)./tmp/gh-aw/cache-memory/api-coherence-progress.jsonto support incremental analysis in future runs.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