mirror of
https://github.com/Z3Prover/z3
synced 2026-01-21 01:24:43 +00:00
Add set_ast_print_mode() to Python, C#, and TypeScript bindings (#8166)
* Initial plan * Add set_ast_print_mode to Python and PrintMode getter to C# Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Add setPrintMode to TypeScript Context API 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 commit is contained in:
parent
b5492e5cf9
commit
cfd40d2588
4 changed files with 45 additions and 1 deletions
|
|
@ -382,6 +382,10 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
|
|||
check(Z3.interrupt(contextPtr));
|
||||
}
|
||||
|
||||
function setPrintMode(mode: Z3_ast_print_mode): void {
|
||||
Z3.set_ast_print_mode(contextPtr, mode);
|
||||
}
|
||||
|
||||
function isModel(obj: unknown): obj is Model<Name> {
|
||||
const r = obj instanceof ModelImpl;
|
||||
r && _assertContext(obj);
|
||||
|
|
@ -4487,6 +4491,7 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
|
|||
// Functions //
|
||||
///////////////
|
||||
interrupt,
|
||||
setPrintMode,
|
||||
isModel,
|
||||
isAst,
|
||||
isSort,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
Z3_ast,
|
||||
Z3_ast_map,
|
||||
Z3_ast_print_mode,
|
||||
Z3_ast_vector,
|
||||
Z3_context,
|
||||
Z3_constructor,
|
||||
|
|
@ -181,6 +182,18 @@ export interface Context<Name extends string = 'main'> {
|
|||
/** @category Functions */
|
||||
interrupt(): void;
|
||||
|
||||
/**
|
||||
* Set the pretty printing mode for ASTs.
|
||||
*
|
||||
* @param mode - The print mode to use:
|
||||
* - Z3_PRINT_SMTLIB_FULL (0): Print AST nodes in SMTLIB verbose format.
|
||||
* - Z3_PRINT_LOW_LEVEL (1): Print AST nodes using a low-level format.
|
||||
* - Z3_PRINT_SMTLIB2_COMPLIANT (2): Print AST nodes in SMTLIB 2.x compliant format.
|
||||
*
|
||||
* @category Functions
|
||||
*/
|
||||
setPrintMode(mode: Z3_ast_print_mode): void;
|
||||
|
||||
/** @category Functions */
|
||||
isModel(obj: unknown): obj is Model<Name>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue