TermManager¶
-
class TermManager¶
A shared handle. Copies share one manager. The manager is destroyed when the last handle, term, sort, solver and model referring to it is destroyed.
Names passed to declare_sort, declare and bind_symbol, and prefixes passed to mk_fresh_sort and mk_fresh, must be representable as SMT-LIB quoted symbols: no NUL, ‘|’, backslash, DEL, or ASCII control characters other than tab, newline and carriage return. Spaces and non-ASCII bytes (including UTF-8) are allowed; the printer quotes where needed. Names and prefixes beginning with ‘@’ or ‘.’ are reserved for solver use. Violations are INVALID_ARGUMENT before any name is recorded. Names must be nonempty; fresh-name prefixes may be empty.
Public Functions
-
explicit TermManager(const Options &manager_options)¶
The same three entries by registry name; a solver-scoped entry that is SET in it is OPTION_VALUE.
-
TermManager(const TermManager&) noexcept¶
-
TermManager(TermManager&&) noexcept¶
-
TermManager &operator=(const TermManager&) noexcept¶
-
TermManager &operator=(TermManager&&) noexcept¶
-
~TermManager()¶
-
std::uint64_t id() const noexcept¶
process-unique
-
bool simplify() const noexcept¶
construction-time folding; fixed
-
RoundingMode default_rounding_mode() const noexcept¶
-
void set_default_rounding_mode(RoundingMode)¶
-
std::uint32_t uf_sort_width() const noexcept¶
-
Sort mk_array_sort(const Sort &index, const Sort &element)¶
UNSUPPORTED for combinations the engine lacks.
-
Sort declare_sort(std::string_view name)¶
named uninterpreted sort, keyed by name; INVALID_ARGUMENT for a sort SMT-LIB predefines (Bool, Real, …)
-
Term declare(std::string_view name, const Sort&)¶
A named symbol, keyed by name in the manager’s one name table: the same name and sort give the same term whether it comes from this call, from Python’s BitVec(‘x’, 32), from a parsed script or from bind_symbol; SORT_MISMATCH if the name is already declared at another sort. In addition to the name rules above, a symbol SMT-LIB’s theories predefine cannot be declared (true, select, bvadd, RNE, +, …): INVALID_ARGUMENT, since |true| and true are the same symbol and no printed script could tell the two apart. INVALID_ARGUMENT for a name retained by define-fun; retrieve it with symbol() instead.
-
Term mk_fresh(const Sort&, std::string_view prefix = "")¶
An anonymous symbol that never enters the name table: fresh on every call, printed as prefix!k with a manager-unique k.
-
std::optional<Term> symbol(std::string_view name) const¶
Name lookup, including retained define-fun names: a nullary definition returns its body; a parameterized one returns a callable FUN term whose applications expand its body.
-
std::vector<Term> symbols() const¶
Declared symbols and parameterized definitions, each identity once. Nullary definitions name expressions, so are found only with symbol().
-
void bind_symbol(std::string_view name, const Term&)¶
a symbol under a second name: SORT_MISMATCH if taken, INVALID_ARGUMENT for a compound term or a predefined name
-
Term mk_bv(std::uint32_t width, std::string_view digits, int base)¶
base 2/10/16; optional
#b/#x/0x; ‘-’ in base 10; ‘_’ between two digits separates them
-
Term mk_bv_bytes(std::uint32_t width, const std::vector<std::uint8_t> &bytes, bool little_endian = true)¶
-
Term mk_fp(const Term &sign, const Term &exponent, const Term &significand)¶
(fp …); symbolic allowed
-
Term mk_fp(const Sort &fp, RoundingMode rm, double value)¶
exact, then rounded once under rm
-
Term mk_fp(const Sort &fp, RoundingMode rm, std::string_view decimal_or_rational)¶
“0.1”, “1/3”, “-2.5e-3”
-
Term mk_rm(RoundingMode)¶
-
Term mk_const_array(const Sort &array_sort, const Term &element)¶
element: a value (no symbol in it), UNSUPPORTED otherwise
-
Term mk_term(Kind, const std::vector<Term> &args, const std::vector<std::uint32_t> &indices = {}, std::optional<Sort> result_sort = std::nullopt)¶
Friends
-
friend bool operator==(const TermManager&, const TermManager&) noexcept¶
-
friend bool operator!=(const TermManager&, const TermManager&) noexcept¶
-
struct Config¶
Public Members
-
bool simplify = true¶
-
RoundingMode default_rounding_mode = RoundingMode::RNE¶
-
std::uint32_t uf_sort_width = 16¶
-
bool simplify = true¶
-
explicit TermManager(const Options &manager_options)¶