tiny.smt.smtlib
Defined in tiny.smt.
Reads SMT-LIB scripts into terms and writes terms back as SMT-LIB text.
API (7)
Actions
Public operations.
parseScript: Reads the scriptsource, adds its constants, functions and terms toctx, and returns aScriptoverctxwith the script's logic and assertions.writeScript: Writes(set-logic L)with the script's logic, then onedeclare-constper named constant of theContext, onedeclare-funper function declaration, oneassertper assertion of the script, and(check-sat), so code can hand a whole formula to another solver or read it back.writeTerm: Writes the termidofctxin SMT-LIB syntax, so code can print a single term for a message or a log, andwriteScriptcalls it for every assertion.
Types and contracts
Public types and contracts.
Error: The error set of the reader's functions: any error.ParseError: The errors the reader returns for unreadable or unsupported text.
Namespaces
Public namespaces.
parse: Reads SMT-LIB text into terms, one command at a time.write: Prints a script or a single term as SMT-LIB text.
Source
Source: lib/smt/src/root.zig:101
zig
pub const smtlib = @import("smtlib/root.zig");Source: lib/smt/src/smtlib/root.zig
zig
//! Reads SMT-LIB scripts into terms and writes terms back as SMT-LIB text. A caller needs to load a//! formula another tool wrote, and to hand a formula it built to another solver. The caller also//! needs a script it wrote to read back as the same formula.//!//! [SMT-LIB](https://smt-lib.org/) is the standard text language of SMT solvers: a script is a//! sequence of parenthesized commands that set a logic, declare constants and functions, assert//! formulas and ask for satisfiability. The reader and the writer use its syntax and its operator//! names.//!//! The reader accepts five commands, `set-logic`, `declare-const`, `declare-fun`, `assert`, and//! `check-sat`, and the sorts `Bool`, `Int`, `(_ BitVec n)`, and arrays from bit-vectors to//! bit-vectors. The reader refuses forms that common SMT-LIB benchmarks use: `let`, `ite`, `xor`,//! `-`, `bvneg`, the `#b` and `#x` literals, and quoted symbols. A script the writer prints reads//! back as the same formula, except for `distinct` with one operand, `+` and `*` with none, and//! constants that share a name. The writer prints a negative integer as `-5`, which this reader//! accepts and standard SMT-LIB readers refuse, since SMT-LIB writes it `(- 5)`. The reader lives//! in `parse` and the writer in `write`, and `parseScript`, `writeScript`, `writeTerm`, `Error`,//! and `ParseError` are re-exported here.pub const parse = @import("parse/root.zig");pub const write = @import("write.zig");pub const Error = parse.Error;pub const ParseError = parse.ParseError;pub const parseScript = parse.parseScript;pub const writeScript = write.writeScript;pub const writeTerm = write.writeTerm;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |