Skip to documentation
SLOP

tiny.smt.choir.names

Reference tiny.smt choir names

Defined in choir.

Code that reads a formula back from an intermediate representation tells its types apart and finds each operation's extra data by comparing names as text, so those names live in one place.

API (2)

Types and contracts

Public types and contracts.

No direct callersNo direct callschoirnames
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/smt/src/choir/names.zig

zig
//! Code that reads a formula back from an intermediate representation tells its types apart and//! finds each operation's extra data by comparing names as text, so those names live in one place.//! The file holds the names of the dialect's three types and the keys of the seven attributes its//! operations carry. The dialect registers its types and builds its operations under these names,//! and a reader of those types and operations has to use the same spelling.//!//! Each type name starts with the dialect's name and a dot (`smt.bool`, `smt.bv` and `smt.array`),//! and the intermediate representation finds the dialect that owns a type from that first part. The//! attribute keys are plain words with no prefix. `name` belongs to variables, function//! applications and assertions, `group` to assertions, `value` to constants, `high` and `low` to//! extractions, `extra` to zero and sign extensions, and `amount` to rotations. `AssertOp.create`//! sets no attribute, `createNamed` sets `name`, and `createGrouped` sets `group`. Every other//! struct with attributes in `SmtDialect` sets them in `create`, and each operation's struct reads//! them through getters, so a caller uses the keys to set or read an attribute on an operation it//! builds or holds without that struct./// The names of the dialect's three types, `boolean`, `bv` and `array`. Code that turns a type back/// into a solver sort compares the type's name with these constants to tell the three types apart./// The dialect registers its types under these names, and the type getters of `SmtDialect` build/// types under them. The namespace and the `dialect` file re-export it.pub const type_names = struct {    /// The name of the Boolean type, `smt.bool`. Code that turns a type into a solver sort compares    /// the type's name with this constant to recognize a Boolean value. `SmtDialect.getBoolType`    /// returns the type.    pub const boolean = "smt.bool";    /// The name every bit-vector type shares, `smt.bv`. Code compares a type's name with this    /// constant before it reads a bit-vector's width. Each bit-vector type carries its width as    /// decimal text, such as `64`, in a key separate from this name, and this name stays the same    /// for every width. `SmtDialect.getBitVecType` builds these types, and `SmtDialect.bitVecWidth`    /// reads the width back.    pub const bv = "smt.bv";    /// The name every array type shares, `smt.array`. Code compares a type's name with this    /// constant before it reads an array's widths. Each array type carries its index width and its    /// element width as text, such as `8:32`, in a key separate from this name, and this name stays    /// the same for every pair of widths. `SmtDialect.getArrayType` builds these types, and    /// `SmtDialect.arrayShape` reads the widths back.    pub const array = "smt.array";};/// The keys of the seven attributes the dialect's operations carry. The operation structs of/// `SmtDialect` set and read every attribute under these keys, and a caller that reads an attribute/// straight from an `ir.Operation` uses the same key. Each operation's specification lists the keys/// of its attributes, and its struct's getters read the attributes back. The namespace and the/// `dialect` file re-export it.pub const attr_names = struct {    /// The key of a name, `name`, held as a string attribute. The structs of variables, function    /// applications and assertions store and read a name under this key. It names a variable    /// (`VarOp`), the function an application applies (`ApplyOp`), and an assertion (`AssertOp`).    pub const name = "name";    /// The key of an assertion's group label, `group`, held as a string attribute.    /// `AssertOp.createGrouped` stores an assertion's group label under this key, and    /// `AssertOp.getGroup` reads it back.    pub const group = "group";    /// The key of a constant's value, `value`. The two constant operations store their value under    /// this key, and their `getValue` functions read it back. `BoolConstOp` holds the value as a    /// Boolean attribute. `BitVecConstOp` holds the value as decimal text in a string attribute.    pub const value = "value";    /// The key of the highest bit position an extraction keeps, `high`, held as an integer    /// attribute. `BvExtractOp.create` stores the extraction's upper bit position under this key,    /// and `BvExtractOp.getHigh` reads it back.    pub const high = "high";    /// The key of the lowest bit position an extraction keeps, `low`, held as an integer attribute.    /// `BvExtractOp.create` stores the extraction's lower bit position under this key, and    /// `BvExtractOp.getLow` reads it back.    pub const low = "low";    /// The key of the number of bits an extension adds, `extra`, held as an integer attribute. The    /// zero and sign extension operations store the number of added bits under this key, and their    /// `getExtra` functions read it back. `BvZeroExtOp` and `BvSignExtOp` carry it.    pub const extra = "extra";    /// The key of the number of positions a rotation turns a bit-vector, `amount`, held as an    /// integer attribute. The two rotation operations store the rotation amount under this key, and    /// their `getAmount` functions read it back. `BvRotlOp` and `BvRotrOp` carry it.    pub const amount = "amount";};

Source: lib/smt/src/choir/root.zig:48

zig
pub const names = @import("names.zig");

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433