[API Coherence] API Coherence Report - February 20, 2026 - Solver & Optimize APIs #8701
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-02-27T03:58:55.494Z.
|
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
Analysis Date: February 20, 2026
APIs Analyzed: Solver APIs, Optimize APIs
Languages Covered: Python, Java, C#, C++, TypeScript/JavaScript, OCaml, Go
Total Functions Checked: 42 (29 Solver + 13 Optimize-related)
Inconsistencies Found: 8 high-priority gaps
Progress
High Priority Issues
1. Missing Solver Congruence APIs in Java
What: Congruence closure APIs are not exposed in Java bindings
Available in: C, C++, Python, C#, TypeScript, Go, OCaml
Missing in: Java
Missing APIs:
Z3_solver_congruence_root→ Should begetCongruenceRoot()Z3_solver_congruence_next→ Should begetCongruenceNext()Z3_solver_congruence_explain→ Should begetCongruenceExplain()Fix: Add methods to
src/api/java/Solver.java:Priority: High
Use Case: These APIs allow users to query the congruence closure maintained by the solver, useful for understanding why terms are equal and for custom decision procedures.
2. Missing Solver.solve_for() in Java
What: The
Z3_solver_solve_forAPI is not wrapped in JavaAvailable in: C, C++, Python, C#
Missing in: Java, TypeScript, Go, OCaml
C API:
Z3_solver_solve_for(c, solver, variables, terms, guards)Fix: Add method to Java Solver class:
Priority: High
Use Case: Solves constraints while treating certain variables as symbolic, useful for synthesis and program analysis.
3. Missing Solver Diagnostic APIs in TypeScript
What: Several solver diagnostic/debugging APIs are missing in TypeScript
Available in: All other languages
Missing in: TypeScript
Missing APIs:
Z3_solver_get_levels→ Should begetLevels()ortrailLevels()Z3_solver_cube→ Should becube()Z3_solver_get_consequences→ Should begetConsequences()Z3_solver_solve_for→ Should besolveFor()Z3_solver_set_initial_value→ Should besetInitialValue()Fix: Add methods to TypeScript Solver class in
src/api/js/src/high-level/high-level.tsPriority: High
Use Case: These APIs are essential for debugging, extracting cubes for CDCL-based solving, getting consequences, and providing solver hints.
4. Missing Optimizer.set_initial_value() in Multiple Languages
What: The
Z3_optimize_set_initial_valueAPI is missing from Java, C#, and TypeScriptAvailable in: C, C++, Python, Go
Missing in: Java, C#, TypeScript
C API:
Z3_optimize_set_initial_value(ctx, opt, var, value)Fix Java (
src/api/java/Optimize.java):Fix C# (
src/api/dotnet/Optimize.cs):Fix TypeScript (
src/api/js/src/high-level/high-level.ts):Priority: High
Use Case: Provides an initial value hint to the optimizer, significantly improving performance for optimization problems by starting from a known feasible point.
Medium Priority Issues
5. Missing Solver.cube() in Go and OCaml
What: The cube extraction API is not available in Go and OCaml
Available in: C, C++, Python, Java, C#, TypeScript
Missing in: Go, OCaml
C API:
Z3_solver_cube(ctx, solver, vars, cutoff)Fix Go (
src/api/go/solver.go):Priority: Medium
Use Case: Used in incremental solving and for extracting partial models. Less commonly used than basic solver operations.
6. Missing Solver.get_consequences() in Go and OCaml
What: The consequences API is not wrapped in Go and OCaml
Available in: C, C++, Python, Java, C#, TypeScript
Missing in: Go, OCaml
C API:
Z3_solver_get_consequences(ctx, solver, assumptions, vars, consequences)Fix: Add wrappers similar to existing implementations in other languages.
Priority: Medium
Use Case: Retrieves fixed assignments (consequences) for variables given assumptions. Useful for partial model extraction and analysis.
Summary Table: Solver API Coverage
Coverage Statistics:
Summary Table: Optimize API Coverage
*Note: TypeScript Optimize class existence needs verification in high-level API
Recommendations
Verification Notes
All findings were verified against the current codebase on February 20, 2026:
Next Steps
For next analysis run, will cover:
This represents approximately 10% of the total Z3 API surface. Continuing with this incremental approach, full API coherence analysis will be completed in ~10 runs.
Beta Was this translation helpful? Give feedback.
All reactions