Repository navigation
Add missing C# API functions for solver introspection and congruence closure - #8126
Merged
Nikolaj Bjorner (NikolajBjorner) merged 3 commits intoJan 9, 2026
Conversation
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Nikolaj Bjorner (NikolajBjorner)
marked this pull request as ready for review
January 8, 2026 23:31
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add missing API functions for the C# API
Add missing C# API functions for solver introspection and congruence closure
Jan 8, 2026
Nikolaj Bjorner (NikolajBjorner)
merged commit Jan 9, 2026
bc4f587
into
master
30 of 43 checks passed
Nuno Lopes (nunoplopes)
deleted the
copilot/add-missing-api-functions-csharp
branch
January 13, 2026 09:18
Nikolaj Bjorner (NikolajBjorner)
added a commit
that referenced
this pull request
Feb 19, 2026
…closure (#8126) * Initial plan * Add missing C# API functions for NonUnits, Trail, and Congruence methods Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix formatting: remove extra blank lines in new properties Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per discussion #8121, the C# API was missing several solver introspection functions available in Python and C++.
Added APIs
Solver introspection:
NonUnitsproperty - Returns non-unit literals in solver stateTrailproperty - Returns solver decision trail (requires SimpleSolver)Congruence closure:
CongruenceRoot(Expr)- Returns congruence closure root of termCongruenceNext(Expr)- Returns congruence closure sibling of termCongruenceExplain(Expr, Expr)- Returns proof of term congruenceImplementation
Added wrapper methods to
Solver.csandNativeSolver.cs. The underlying C API functions (Z3_solver_get_non_units,Z3_solver_get_trail,Z3_solver_congruence_*) already existed;Native.csbindings are auto-generated during build.Example usage:
This brings C# to parity with Python for these functions.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.