SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
stabilizer_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 <string>
24
26class Parser;
27}
28
29namespace stabilizer::api {
30
42 public:
44
46 void set_rewrite(bool rewrite) noexcept { d_rewrite = rewrite; }
48 bool get_rewrite() const noexcept { return d_rewrite; }
49
51 void set_context_propagation(bool value) noexcept { d_context_propagation = value; }
53 bool get_context_propagation() const noexcept { return d_context_propagation; }
54
56 void set_subgraph_pruning(bool value) noexcept { d_subgraph_pruning = value; }
58 bool get_subgraph_pruning() const noexcept { return d_subgraph_pruning; }
59
60 private:
61 bool d_rewrite = true;
63 bool d_subgraph_pruning = true;
64};
65
82 public:
84
86 const SMTStabilizerOptions &options() const noexcept;
88 void set_options(const SMTStabilizerOptions &options) noexcept;
89
97 std::string apply_file(const std::string &file_path) const;
98
106 std::string apply_text(const std::string &smt2_text) const;
107
108 private:
110
113
117 static std::string run_pipeline(stabilizer::parser::Parser &parser, const SMTStabilizerOptions &options);
118};
119
120} // namespace stabilizer::api
Public options for the SMTStabilizer API.
bool get_subgraph_pruning() const noexcept
void set_context_propagation(bool value) noexcept
void set_subgraph_pruning(bool value) noexcept
bool get_context_propagation() const noexcept
void set_rewrite(bool rewrite) noexcept
High-level facade for stabilizing SMT-LIB2 inputs.
std::string apply_file(const std::string &file_path) const
Apply the full pipeline to an SMT-LIB2 file.
std::string apply_text(const std::string &smt2_text) const
Apply the full pipeline to an SMT-LIB2 script provided as text.
const SMTStabilizerOptions & options() const noexcept
static std::string run_pipeline(stabilizer::parser::Parser &parser, const SMTStabilizerOptions &options)
static void configure_parser(stabilizer::parser::Parser &parser, const SMTStabilizerOptions &options)
void set_options(const SMTStabilizerOptions &options) noexcept
SMTStabilizerOptions d_options