SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
stabilizer_c_api.h
Go to the documentation of this file.
1// Copyright (c) 2026 XiangZhang
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19// SOFTWARE.
20
21#pragma once
22
23#include <stdbool.h>
24#include <stddef.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
34
46
52
58
64void stabilizer_options_set_rewrite(stabilizer_options *options, bool value);
65
72
79
86
93
100
107
113
119void stabilizer_set_rewrite(stabilizer_handle *handle, bool value);
120
126bool stabilizer_get_rewrite(const stabilizer_handle *handle);
127
134
141
147void stabilizer_set_subgraph_pruning(stabilizer_handle *handle, bool value);
148
155
169stabilizer_status stabilizer_apply_file(stabilizer_handle *handle, const char *file_path, char **output);
170
184stabilizer_status stabilizer_apply_text(stabilizer_handle *handle, const char *smt2_text, char **output);
185
191const char *stabilizer_last_error(const stabilizer_handle *handle);
192
197void stabilizer_free_string(char *value);
198
199#ifdef __cplusplus
200}
201#endif
void stabilizer_options_set_context_propagation(stabilizer_options *options, bool value)
Enable or disable kernel context propagation.
Definition c_api.cpp:112
bool stabilizer_options_get_subgraph_pruning(const stabilizer_options *options)
Query kernel subgraph pruning/tie-breaking behavior.
Definition c_api.cpp:128
bool stabilizer_get_subgraph_pruning(const stabilizer_handle *handle)
Query subgraph pruning/tie-breaking behavior on a live stabilizer.
Definition c_api.cpp:175
const char * stabilizer_last_error(const stabilizer_handle *handle)
Return the last diagnostic message associated with a handle.
Definition c_api.cpp:205
stabilizer_handle * stabilizer_create(const stabilizer_options *options)
Create a stabilizer instance.
Definition c_api.cpp:132
bool stabilizer_options_get_context_propagation(const stabilizer_options *options)
Query kernel context propagation flag.
Definition c_api.cpp:118
bool stabilizer_get_rewrite(const stabilizer_handle *handle)
Query rewrite normalization on a live stabilizer.
Definition c_api.cpp:149
void stabilizer_set_subgraph_pruning(stabilizer_handle *handle, bool value)
Update subgraph pruning/tie-breaking behavior on a live stabilizer.
Definition c_api.cpp:166
void stabilizer_set_rewrite(stabilizer_handle *handle, bool value)
Update rewrite normalization on a live stabilizer.
Definition c_api.cpp:140
void stabilizer_options_set_rewrite(stabilizer_options *options, bool value)
Enable or disable parser rewrite normalization.
Definition c_api.cpp:102
void stabilizer_options_set_subgraph_pruning(stabilizer_options *options, bool value)
Enable or disable kernel subgraph pruning/tie-breaking behavior.
Definition c_api.cpp:122
void stabilizer_free_string(char *value)
Release strings returned through stabilizer_apply_*.
Definition c_api.cpp:209
void stabilizer_options_destroy(stabilizer_options *options)
Release an options object created by stabilizer_options_create.
Definition c_api.cpp:98
void stabilizer_set_context_propagation(stabilizer_handle *handle, bool value)
Update context propagation on a live stabilizer.
Definition c_api.cpp:153
stabilizer_status stabilizer_apply_text(stabilizer_handle *handle, const char *smt2_text, char **output)
Apply stabilization pipeline to SMT-LIB2 text.
Definition c_api.cpp:192
void stabilizer_destroy(stabilizer_handle *handle)
Destroy a stabilizer instance and associated internal state.
Definition c_api.cpp:136
bool stabilizer_get_context_propagation(const stabilizer_handle *handle)
Query context propagation on a live stabilizer.
Definition c_api.cpp:162
bool stabilizer_options_get_rewrite(const stabilizer_options *options)
Query parser rewrite normalization flag.
Definition c_api.cpp:108
stabilizer_options * stabilizer_options_create(void)
Allocate a new options object with default values.
Definition c_api.cpp:94
stabilizer_status
Result status for C API calls.
@ STABILIZER_STATUS_OK
@ STABILIZER_STATUS_RUNTIME_ERROR
@ STABILIZER_STATUS_INVALID_ARGUMENT
stabilizer_status stabilizer_apply_file(stabilizer_handle *handle, const char *file_path, char **output)
Apply stabilization pipeline to an SMT-LIB2 file.
Definition c_api.cpp:179