[API Coherence] Report for 2026-03-16 - Context/Config, Parser, Statistics, AST Vector/Map APIs #9011
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by API Coherence Checker. A newer discussion is available at Discussion #9021. |
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
Analyzed 4 new API families in this run, while re-verifying 9 previously cached issues.
✅ Resolution Updates
The following issues from previous runs have been resolved since the last check:
1. TypeScript
seq_map/seq_mapi/seq_foldl/seq_foldli— RESOLVEDAll four sequence higher-order operations are now implemented in
src/api/js/src/high-level/high-level.ts(lines 4427–4441).2. Go
GoalmissingDepth(),ConvertModel(),Translate(),Precision()— RESOLVEDAll four methods are now present in
src/api/go/tactic.go(lines 203–222).3. Go
Model/FuncInterpmissingFuncEntrytype,GetEntry(),AddEntry(),SetElse(),HasInterp()— RESOLVEDAll implemented in
src/api/go/solver.go(lines 504–558).Progress
High Priority Issues
(None elevated to High in this run — existing Medium issues remain the priority)
Medium Priority Issues
1. Go Missing Global Parameter Functions
What: Go has no wrapper for
Z3_global_param_set,Z3_global_param_get, orZ3_global_param_reset_all. These allow setting/getting/resetting module-level Z3 parameters that affect all contexts (e.g., pretty-printer settings, debug flags).Available in: Python (
z3py), Java (Global.setParameter/getParameter), .NET (Global.cs), TypeScript (setGlobalParam/getGlobalParam/resetAllGlobalParams), OCaml (set_global_param/get_global_param/global_param_reset_all), Rust (set_global_param/get_global_param/reset_all_global_paramsinz3/src/params.rs)Missing in: Go (
src/api/go/)Suggested fix: Add
SetGlobalParam(id, value string),GetGlobalParam(id string) (string, bool), andResetAllGlobalParams()free functions tosrc/api/go/z3.go.Verified: Checked
src/api/go/*.goon 2026-03-16 — no calls toZ3_global_param_*found.2. Go Missing Standalone
ParseSMTLIB2String/ParseSMTLIB2File(returningAstVector)What: Go lacks a standalone
Z3_parse_smtlib2_string/Z3_parse_smtlib2_filewrapper that returns anAstVectorof parsed formulas. Go hasSolver.FromString/Solver.FromFilewhich useZ3_solver_from_string— a different function that asserts parsed formulas directly into a specific solver (no return value). The standalone parse functions allow more flexibility: parse once, inspect the formulas, add them to multiple solvers, or use them in tactics.Available in: Python (
parse_smtlib2_string,parse_smtlib2_file), Java (Context.parseSMTLIB2String/parseSMTLIB2File), .NET (Context.ParseSMTLIB2String/ParseSMTLIB2File), TypeScript (Z3.parse_smtlib2_string), OCaml (SMT.parse_smtlib2_string/parse_smtlib2_file)Missing in: Go (high-level), Rust (high-level; z3-sys has FFI binding at line 5082 of
z3-sys/src/lib.rs)Suggested fix (Go): Add
func (ctx *Context) ParseSMTLIB2String(str string, sortNames []string, sorts []*Sort, declNames []string, decls []*FuncDecl) []*Exprtosrc/api/go/solver.goor a newsrc/api/go/parser.go.Suggested fix (Rust): Add a
parse_smtlib2_string(ctx: &Context, s: &str) -> Vec(Bool)function wrappingZ3_parse_smtlib2_stringinz3/src/solver.rsor a newz3/src/parser.rs.Verified: No
Z3_parse_smtlib2_stringcall found insrc/api/go/*.go; noparse_smtlib2in/tmp/z3.rs/z3/src/.3. Incremental
ParserContextAPI Missing in Most LanguagesWhat: The incremental parser context API (
Z3_parser_context_add_sort,Z3_parser_context_add_decl,Z3_parser_context_from_string) allows building up a parsing context incrementally — declaring sorts and function declarations once, then parsing multiple SMT-LIB2 strings against the same context. This is more efficient and ergonomic for tools that parse many related formulas.Available in: Python only (
z3.pylines 9943–9961 —class ParserContextwithadd_sort(),add_decl(),from_string()). OCaml has only the native binding type (parser_context = ptr) without a high-level wrapper.Missing in: Java, .NET, Go, TypeScript, Rust (all 5 lack the incremental context; Rust also lacks the basic
parse_smtlib2_string)Suggested fix: Each language binding should add a
ParserContext(or equivalent) class/struct with:Z3_mk_parser_contextaddSort(sort)/add_sort/ etc.addDecl(decl)/add_decl/ etc.fromString(s)returning a list/vector/array ofBoolExprVerified: Checked all language binding directories on 2026-03-16 — only Python has the implementation.
4. Rust Missing Multiple Solver APIs (Carried Over)
What: The Rust high-level
z3crate (z3/src/solver.rs) is missing wrappers for newer Z3 solver features:cube—Z3_solver_cube(cube-guided CDCL)get_trail—Z3_solver_get_trailsolve_for—Z3_solver_solve_forcongruence_lhs/congruence_rhs—Z3_solver_congruence_lhs/rhsset_initial_value—Z3_solver_set_initial_valueadd_simplifier—Z3_solver_add_simplifierregister_on_clause—Z3_solver_register_on_clauseto_dimacs_string—Z3_solver_to_dimacs_stringAvailable in: Python, Java, .NET, C++, OCaml, Go, TypeScript
Missing in: Rust (both z3-sys FFI layer and high-level z3 crate)
Suggested fix: First add FFI bindings to
z3-sys/src/lib.rs, then add high-level wrappers inz3/src/solver.rs.Verified: 2026-03-16 — no
cube/get_trail/solve_for/congruence/add_simplifier/register_on_clause/dimacsfound in/tmp/z3.rs/z3/src/solver.rs.5. Rust Missing Seq/String Operations (Carried Over)
What: Rust
z3/src/ast/seq.rsandz3/src/ast/string.rsare missing wrappers for many sequence operations even thoughz3-syshas all the FFI bindings. Missing:replace,is_prefix,is_suffix,index,last_index,map,mapi,foldl,foldli, and the fullreplace_all/replace_re/replace_re_allfamily.Available in: Python, Java, .NET, C++, OCaml, Go, TypeScript
Missing in: Rust (high-level only —
z3-syshas the FFI atz3-sys/src/lib.rslines 3185–3229+)Suggested fix: Add methods to
z3/src/ast/seq.rsandz3/src/ast/string.rscalling the existingz3-sysbindings.Verified: 2026-03-16 —
Seq::replace,Seq::is_prefix,Seq::is_suffix,Seq::index,Seq::map,Seq::foldlnot found.6. Rust Fixedpoint Missing Several Functions (Carried Over)
What: Rust
z3/src/fixedpoint.rslacks:get_rules(Z3_fixedpoint_get_rules— returns current rules),get_param_descrs(Z3_fixedpoint_get_param_descrs),set_predicate_representation(Z3_fixedpoint_set_predicate_representation).Available in: Python, Java, .NET, C++, OCaml, Go, TypeScript
Missing in: Rust
Suggested fix: Add methods to
z3/src/fixedpoint.rsin the externalprove-rs/z3.rsrepository.Verified: 2026-03-16 —
fn get_rules,fn get_param_descrs,fn set_predicate_representationnot found in/tmp/z3.rs/z3/src/fixedpoint.rs.Low Priority Issues
7. Rust BV Missing
repeatOperation (Carried Over)What:
Z3_mk_repeat(repeat a bitvector n times) is bound inz3-sysbut has no wrapper inz3/src/ast/bv.rs.Available in: Python, C++, Java, .NET, OCaml, TypeScript, Go
Missing in: Rust (high-level)
Suggested fix: Add
pub fn repeat(&self, n: u32) -> Selftoz3/src/ast/bv.rs.Verified: 2026-03-16 — no
fn repeatinbv.rs.8. Rust Tactic Missing Parallel Combinators (Carried Over)
What: Rust
z3/src/tactic.rsis missingpar_or(Z3_tactic_par_or),par_and_then(Z3_tactic_par_and_then).Available in: Python, Java, .NET, C++, OCaml, Go, TypeScript
Missing in: Rust
Suggested fix: Add
Tactic::par_or(t1: &Tactic, t2: &Tactic) -> TacticandTactic::par_and_then(t1: &Tactic, t2: &Tactic) -> Tactic.Verified: 2026-03-16 — no
par_ororpar_and_thenfound.APIs with Good Coherence (This Run)
The following APIs were found to be well-implemented across all languages:
Z3_stats_*): All languages exposeget_statistics()on Solver (and Fixedpoint where applicable) with consistent key/value iteration.AstVector/AstMaptype (acceptable given Go idioms).update_param_value(per-context params): Available in all languages.Next Run
Suggested APIs to analyze:
Z3_mk_int_sort,Z3_get_sort_kind,Z3_func_decl_*,Z3_mk_fresh_func_decl)Z3_algebraic_*)Z3_interpolate_*)Z3_propagate_*)Beta Was this translation helpful? Give feedback.
All reactions