[API Coherence] API Coherence Report - January 10, 2026: Tactic, Goal, Probe & Quantifier APIs #8139
Closed
Replies: 0 comments
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.
-
This is the fourth systematic analysis of API coherence across Z3's language bindings, focusing on Tactic APIs, Goal APIs, Probe APIs, and Quantifier APIs.
Executive Summary
APIs Analyzed: 80 C API functions across 4 major API families
Languages: C, C++, Python, Java, .NET (C#), TypeScript/JavaScript
Overall Coherence: C++, Python, Java, and C# have 100% coverage for these APIs
Critical Gap: TypeScript has severe gaps (~30% coverage), with Goal API completely missing
Key Findings
Critical Issues Requiring Action
1. TypeScript: Missing Goal API 🚨 CRITICAL
The Goal API is completely absent from TypeScript bindings, making the entire tactics system unusable.
What's missing: All 17 Goal functions from C API
Z3_mk_goalZ3_goal_assert,Z3_goal_resetZ3_goal_size,Z3_goal_depth,Z3_goal_inconsistentZ3_goal_is_decided_sat,Z3_goal_is_decided_unsatAvailable in: Python ✅, Java ✅, C# ✅, C++ ✅
Missing in: TypeScript ❌
Impact: Users cannot create goals, which are the fundamental input to tactics. Even though
TacticandProbeinterfaces exist, they cannot be used meaningfully.Files to modify:
src/api/js/src/high-level/types.ts,src/api/js/src/high-level/high-level.ts2. TypeScript: Severely Limited Tactic API 🚨 HIGH
TypeScript has
Tacticinterface but is missing most methods and combinators.Missing methods:
apply(goal)- Cannot execute tacticssolver()- Cannot create solver from tactichelp()- No documentation accessparamDescrs()- No parameter introspectionMissing combinators:
repeat(n),tryFor(ms),when(probe),skip(),fail(),failIf(probe)parOr(),parAndThen()- Parallel combinatorsAvailable: Only
Tacticconstructor and basicCond()functionComparison:
apply(),solver(),help(),param_descrs()✅apply(),mkSolver(),getHelp(),getParameterDescriptions()✅apply(),mk_solver(),help(), operators&/|,repeat(),try_for()✅3. TypeScript: Missing ApplyResult API 🚨 HIGH
No way to handle tactic application results.
Missing: All 6 ApplyResult functions
Z3_apply_result_get_num_subgoalsZ3_apply_result_get_subgoalZ3_apply_result_to_stringImpact: Even if
Tactic.apply()existed, users couldn't access the resulting subgoals.Available in: Python ✅ (
ApplyResultclass), Java ✅, C# ✅, C++ ✅Missing in: TypeScript ❌
4. TypeScript: Incomplete Quantifier Introspection⚠️ MEDIUM
Can create quantifiers but cannot inspect them programmatically.
Available:
ForAll(),Exists()- Creation worksvar_name(idx),var_sort(idx)- Basic introspection (found in tests)Missing introspection:
isForall(),isExists()- Type checkingweight()- Quantifier weightnumPatterns(),pattern(i)- Pattern accessbody()- Body extractionqid(),skolemId()- IdentifiersAvailable in other languages:
QuantifierRefmethods ✅Quantifierclass with all methods ✅Quantifierclass with properties ✅exprclass ✅Detailed Statistics
Coverage by Language (for analyzed APIs)
API Functions Analyzed
Issue Breakdown
Progress Tracking
Cumulative Analysis
Completed: 16 / ~40 API families (40%)
Analyzed so far:
Next priorities:
Recommendations
For TypeScript Maintainers (Priority Order)
Critical (Blocks major functionality)
Goalinterface with all 17 methodsHigh (Significantly limits usability)
repeat(),tryFor(),when(),skip(),fail()help(),paramDescrs()Medium (Improves experience)
isForall(),weight(),pattern(),body()For All Language Maintainers
File References
Key Files Analyzed
C API Baseline:
src/api/z3_api.hlines 6224-6818 (Tactic/Goal/Probe/ApplyResult)src/api/z3_api.hlines 4265-5406 (Quantifiers)Python (Complete ✅):
src/api/python/z3/z3.pylines 5694-5970 (Goal, ApplyResult, Tactic)src/api/python/z3/z3.pylines 8470-8900 (Tactic, Probe)src/api/python/z3/z3.pylines 2095-2342 (Quantifiers)Java (Complete ✅):
src/api/java/Goal.java,Tactic.java,Probe.java,ApplyResult.java,Quantifier.javaC# (Complete ✅):
src/api/dotnet/Goal.cs,Tactic.cs,Probe.cs,ApplyResult.cs,Quantifier.csC++ (Complete ✅):
src/api/c++/z3++.hlines 3067-3360 (goal, tactic, probe, apply_result classes)src/api/c++/z3++.hlines 2350-2397 (quantifier functions)TypeScript (Incomplete⚠️ ):
src/api/js/src/high-level/types.tslines 2120-2173 (Tactic/Probe/Quantifier interfaces)src/api/js/src/high-level/high-level.tslines 1091-1122, 2204-2213 (implementations)Conclusion
The analysis reveals that TypeScript bindings lag significantly behind other languages in the tactics subsystem. The Goal API is completely missing, making tactics unusable despite having basic
TacticandProbeinterfaces.C++, Python, Java, and C# all provide complete, mature implementations. The TypeScript gaps represent a significant usability issue for JavaScript/TypeScript users who want to use Z3's powerful tactic-based solving framework.
Next analysis: Will cover AST Map, Parameter management, Simplifier, and Polynomial APIs.
This is an automated analysis. For detailed findings, see cached report at
/tmp/gh-aw/cache-memory/findings_2026-01-10.md.Beta Was this translation helpful? Give feedback.
All reactions