mlir.dialects._smt_ops_gen

Attributes

Classes

_Dialect

AndOp

This operation performs a boolean conjunction.

ApplyFuncOp

This operation performs a function application as described in the

ArrayBroadcastOp

This operation represents a broadcast of the 'value' operand to all indices

ArraySelectOp

This operation is retuns the value stored in the given array at the given

ArrayStoreOp

This operation returns a new array which is the same as the 'array' operand

AssertOp

BV2IntOp

Create an integer from the bit-vector argument input. If is_signed is

BVAShrOp

This operation performs arithmetic shift right. The semantics are

BVAddOp

This operation performs addition. The semantics are

BVAndOp

This operation performs bitwise AND. The semantics are

BVCmpOp

This operation compares bit-vector values, interpreting them as signed or

BVConstantOp

This operation produces an SSA value equal to the bit-vector constant

BVLShrOp

This operation performs logical shift right. The semantics are

BVMulOp

This operation performs multiplication. The semantics are

BVNegOp

This operation performs two's complement unary minus. The semantics are

BVNotOp

This operation performs bitwise negation. The semantics are

BVOrOp

This operation performs bitwise OR. The semantics are

BVSDivOp

This operation performs two's complement signed division. The semantics are

BVSModOp

This operation performs two's complement signed remainder (sign follows divisor). The semantics are

BVSRemOp

This operation performs two's complement signed remainder (sign follows dividend). The semantics are

BVShlOp

This operation performs shift left. The semantics are

BVUDivOp

This operation performs unsigned division (rounded towards zero). The semantics are

BVURemOp

This operation performs unsigned remainder. The semantics are

BVXOrOp

This operation performs bitwise exclusive OR. The semantics are

BoolConstantOp

Produces the constant expressions 'true' and 'false' as described in the

CheckOp

This operation checks if all the assertions in the solver defined by the

ConcatOp

This operation concatenates bit-vector values with semantics equivalent to

DeclareFunOp

This operation declares a symbolic value just as the declare-const and

DistinctOp

This operation compares the operands and returns true iff all operands are

EqOp

This operation compares the operands and returns true iff all operands are

ExistsOp

This operation represents the exists quantifier as described in the

ExtractOp

This operation extracts the range of bits starting at the 'lowBit' index

ForallOp

This operation represents the forall quantifier as described in the

ImpliesOp

This operation performs a boolean implication. The semantics are equivalent

Int2BVOp

Designed to lower directly to an operation of the same name in Z3. The Z3

IntAbsOp

This operation represents the absolute value function for the Int sort.

IntAddOp

This operation represents (infinite-precision) integer addition.

IntCmpOp

This operation represents the comparison of (infinite-precision) integers.

IntConstantOp

This operation represents (infinite-precision) integer literals of the Int

IntDivOp

This operation represents (infinite-precision) integer division.

IntModOp

This operation represents (infinite-precision) integer remainder.

IntMulOp

This operation represents (infinite-precision) integer multiplication.

IntSubOp

This operation represents (infinite-precision) integer subtraction.

IteOp

This operation returns its second operand or its third operand depending on

NotOp

This operation performs a boolean negation. The semantics are equivalent to

OrOp

This operation performs a boolean disjunction.

PopOp

PushOp

RepeatOp

This operation is a shorthand for repeated concatenation of the same

ResetOp

SetLogicOp

SolverOp

This operation defines an SMT context with a solver instance. SMT operations

XOrOp

This operation performs a boolean exclusive OR.

YieldOp

Functions

and_(→ _ods_ir)

apply_func(→ _ods_ir)

array_broadcast(→ _ods_ir)

array_select(→ _ods_ir)

array_store(→ _ods_ir)

assert_(→ AssertOp)

bv2int(→ _ods_ir)

bv_ashr(→ _ods_ir)

bv_add(→ _ods_ir)

bv_and(→ _ods_ir)

bv_cmp(→ _ods_ir)

bv_constant(→ _ods_ir)

bv_lshr(→ _ods_ir)

bv_mul(→ _ods_ir)

bv_neg(→ _ods_ir)

bv_not(→ _ods_ir)

bv_or(→ _ods_ir)

bv_sdiv(→ _ods_ir)

bv_smod(→ _ods_ir)

bv_srem(→ _ods_ir)

bv_shl(→ _ods_ir)

bv_udiv(→ _ods_ir)

bv_urem(→ _ods_ir)

bv_xor(→ _ods_ir)

constant(→ _ods_ir)

check(→ Union[_ods_ir, _ods_ir, CheckOp])

bv_concat(→ _ods_ir)

declare_fun(→ _ods_ir)

distinct(→ _ods_ir)

eq(→ _ods_ir)

exists(→ _ods_ir)

bv_extract(→ _ods_ir)

forall(→ _ods_ir)

implies(→ _ods_ir)

int2bv(→ _ods_ir)

int_abs(→ _ods_ir)

int_add(→ _ods_ir)

int_cmp(→ _ods_ir)

int_constant(→ _ods_ir)

int_div(→ _ods_ir)

int_mod(→ _ods_ir)

int_mul(→ _ods_ir)

int_sub(→ _ods_ir)

ite(→ _ods_ir)

not_(→ _ods_ir)

or_(→ _ods_ir)

pop(→ PopOp)

push(→ PushOp)

bv_repeat(→ _ods_ir)

reset(→ ResetOp)

set_logic(→ SetLogicOp)

solver(→ Union[_ods_ir, _ods_ir, SolverOp])

xor(→ _ods_ir)

yield_(→ YieldOp)

Module Contents

mlir.dialects._smt_ops_gen._ods_ir
class mlir.dialects._smt_ops_gen._Dialect(descriptor: object)

Bases: _ods_ir

DIALECT_NAMESPACE = 'smt'
class mlir.dialects._smt_ops_gen.AndOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a boolean conjunction. The semantics are equivalent to the ‘and’ operator in the Core theory. of the SMT-LIB Standard 2.7.

It supports a variadic number of operands, but requires at least two.
This is because the operator is annotated with the `:left-assoc` attribute
which means that `op a b c` is equivalent to `(op (op a b) c)`.
OPERATION_NAME = 'smt.and'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.and_(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ApplyFuncOp(func, args, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a function application as described in the SMT-LIB 2.7 standard. It is part of the language itself rather than a theory or logic.

OPERATION_NAME = 'smt.apply_func'
_ODS_REGIONS = (0, True)
func() _ods_ir
args() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.apply_func(func, args, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ArrayBroadcastOp(result, value, *, loc=None, ip=None)

Bases: _ods_ir

This operation represents a broadcast of the ‘value’ operand to all indices of the array. It is equivalent to

%0 = smt.declare_fun "array" : !smt.array<[!smt.int -> !smt.bool]>
%1 = smt.forall ["idx"] {
^bb0(%idx: !smt.int):
  %2 = smt.array.select %0[%idx] : !smt.array<[!smt.int -> !smt.bool]>
  %3 = smt.eq %value, %2 : !smt.bool
  smt.yield %3 : !smt.bool
}
smt.assert %1
// return %0

In SMT-LIB, this is frequently written as ((as const (Array Int Bool)) value).

OPERATION_NAME = 'smt.array.broadcast'
_ODS_REGIONS = (0, True)
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.array_broadcast(result, value, *, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ArraySelectOp(array, index, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation is retuns the value stored in the given array at the given index. The semantics are equivalent to the select operator defined in the SMT ArrayEx theory of the SMT-LIB standard 2.7.

OPERATION_NAME = 'smt.array.select'
_ODS_REGIONS = (0, True)
array() _ods_ir
index() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.array_select(array, index, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ArrayStoreOp(array, index, value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation returns a new array which is the same as the ‘array’ operand except that the value at the given ‘index’ is changed to the given ‘value’. The semantics are equivalent to the ‘store’ operator described in the SMT ArrayEx theory of the SMT-LIB standard 2.7.

OPERATION_NAME = 'smt.array.store'
_ODS_REGIONS = (0, True)
array() _ods_ir
index() _ods_ir
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.array_store(array, index, value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.AssertOp(input, *, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.assert'
_ODS_REGIONS = (0, True)
input() _ods_ir
mlir.dialects._smt_ops_gen.assert_(input, *, loc=None, ip=None) AssertOp
class mlir.dialects._smt_ops_gen.BV2IntOp(input, *, is_signed=None, results=None, loc=None, ip=None)

Bases: _ods_ir

Create an integer from the bit-vector argument input. If is_signed is present, the bit-vector is treated as two’s complement signed. Otherwise, it is treated as an unsigned integer in the range [0..2^N-1], where N is the number of bits in input.

OPERATION_NAME = 'smt.bv2int'
_ODS_REGIONS = (0, True)
input() _ods_ir
is_signed() bool
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv2int(input, *, is_signed=None, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVAShrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs arithmetic shift right. The semantics are equivalent to the bvashr operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.ashr'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_ashr(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVAddOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs addition. The semantics are equivalent to the bvadd operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.add'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_add(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVAndOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs bitwise AND. The semantics are equivalent to the bvand operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.and'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_and(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVCmpOp(pred, lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation compares bit-vector values, interpreting them as signed or unsigned values depending on the predicate. The semantics are equivalent to the bvslt, bvsle, bvsgt, bvsge, bvult, bvule, bvugt, or bvuge operator defined in the SMT-LIB 2.7 standard depending on the specified predicate. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.cmp'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
pred() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_cmp(pred, lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVConstantOp(value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation produces an SSA value equal to the bit-vector constant specified by the ‘value’ attribute. Refer to the BitVectorAttr documentation for more information about the semantics of bit-vector constants, their format, and associated sort. The result type always matches the attribute’s type.

Examples:

%c92_bv8 = smt.bv.constant #smt.bv<92> : !smt.bv<8>
%c5_bv4 = smt.bv.constant #smt.bv<5> : !smt.bv<4>
OPERATION_NAME = 'smt.bv.constant'
_ODS_REGIONS = (0, True)
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_constant(value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVLShrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs logical shift right. The semantics are equivalent to the bvlshr operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.lshr'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_lshr(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVMulOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs multiplication. The semantics are equivalent to the bvmul operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.mul'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_mul(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVNegOp(input, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs two’s complement unary minus. The semantics are equivalent to the bvneg operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.neg'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_neg(input, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVNotOp(input, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs bitwise negation. The semantics are equivalent to the bvnot operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.not'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_not(input, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVOrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs bitwise OR. The semantics are equivalent to the bvor operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.or'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_or(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVSDivOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs two’s complement signed division. The semantics are equivalent to the bvsdiv operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.sdiv'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_sdiv(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVSModOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs two’s complement signed remainder (sign follows divisor). The semantics are equivalent to the bvsmod operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.smod'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_smod(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVSRemOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs two’s complement signed remainder (sign follows dividend). The semantics are equivalent to the bvsrem operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.srem'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_srem(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVShlOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs shift left. The semantics are equivalent to the bvshl operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.shl'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_shl(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVUDivOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs unsigned division (rounded towards zero). The semantics are equivalent to the bvudiv operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.udiv'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_udiv(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVURemOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs unsigned remainder. The semantics are equivalent to the bvurem operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.urem'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_urem(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BVXOrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs bitwise exclusive OR. The semantics are equivalent to the bvxor operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.xor'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_xor(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.BoolConstantOp(value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

Produces the constant expressions ‘true’ and ‘false’ as described in the Core theory of the SMT-LIB Standard 2.7.

OPERATION_NAME = 'smt.constant'
_ODS_REGIONS = (0, True)
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.constant(value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.CheckOp(results_, *, loc=None, ip=None)

Bases: _ods_ir

This operation checks if all the assertions in the solver defined by the nearest ancestor operation of type smt.solver are consistent. The outcome an be ‘satisfiable’, ‘unknown’, or ‘unsatisfiable’ and the corresponding region will be executed. It is the corresponding construct to the check-sat in SMT-LIB.

Example:

%0 = smt.check sat {
  %c1_i32 = arith.constant 1 : i32
  smt.yield %c1_i32 : i32
} unknown {
  %c0_i32 = arith.constant 0 : i32
  smt.yield %c0_i32 : i32
} unsat {
  %c-1_i32 = arith.constant -1 : i32
  smt.yield %c-1_i32 : i32
} -> i32
OPERATION_NAME = 'smt.check'
_ODS_REGIONS = (3, True)
results_() _ods_ir
satRegion() _ods_ir
unknownRegion() _ods_ir
unsatRegion() _ods_ir
mlir.dialects._smt_ops_gen.check(results_, *, loc=None, ip=None) _ods_ir | _ods_ir | CheckOp
class mlir.dialects._smt_ops_gen.ConcatOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation concatenates bit-vector values with semantics equivalent to the concat operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

Note that the following equivalences hold:

  • smt.bv.concat %a, %b : !smt.bv<4>, !smt.bv<4> is equivalent to

(concat a b) in SMT-LIB * (= (concat #xf #x0) #xf0)

OPERATION_NAME = 'smt.bv.concat'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_concat(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.DeclareFunOp(result, *, namePrefix=None, loc=None, ip=None)

Bases: _ods_ir

This operation declares a symbolic value just as the declare-const and declare-fun statements in SMT-LIB 2.7. The result type determines the SMT sort of the symbolic value. The returned value can then be used to refer to the symbolic value instead of using the identifier like in SMT-LIB.

The optionally provided string will be used as a prefix for the newly generated identifier (useful for easier readability when exporting to SMT-LIB). Each declare will always provide a unique new symbolic value even if the identifier strings are the same.

Note that there does not exist a separate operation equivalent to SMT-LIBs define-fun since

(define-fun f (a Int) Int (-a))

is only syntactic sugar for

%f = smt.declare_fun : !smt.func<(!smt.int) !smt.int>
%0 = smt.forall {
^bb0(%arg0: !smt.int):
  %1 = smt.apply_func %f(%arg0) : !smt.func<(!smt.int) !smt.int>
  %2 = smt.int.neg %arg0
  %3 = smt.eq %1, %2 : !smt.int
  smt.yield %3 : !smt.bool
}
smt.assert %0

Note that this operation cannot be marked as Pure since two operations (even with the same identifier string) could then be CSEd, leading to incorrect behavior.

OPERATION_NAME = 'smt.declare_fun'
_ODS_REGIONS = (0, True)
namePrefix() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.declare_fun(result, *, name_prefix=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.DistinctOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation compares the operands and returns true iff all operands are not identical to any of the other operands. The semantics are equivalent to the distinct operator defined in the SMT-LIB Standard 2.7 in the Core theory.

Any SMT sort/type is allowed for the operands and it supports a variadic number of operands, but requires at least two. This is because the distinct operator is annotated with :pairwise which means that distinct a b c d is equivalent to

and (distinct a b) (distinct a c) (distinct a d)
    (distinct b c) (distinct b d)
    (distinct c d)

where and is annotated :left-assoc, i.e., it can be further rewritten to

(and (and (and (and (and (distinct a b)
                         (distinct a c))
                    (distinct a d))
               (distinct b c))
          (distinct b d))
     (distinct c d)
OPERATION_NAME = 'smt.distinct'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.distinct(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.EqOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation compares the operands and returns true iff all operands are identical. The semantics are equivalent to the = operator defined in the SMT-LIB Standard 2.7 in the Core theory.

Any SMT sort/type is allowed for the operands and it supports a variadic number of operands, but requires at least two. This is because the = operator is annotated with :chainable which means that = a b c d is equivalent to and (= a b) (= b c) (= c d) where and is annotated :left-assoc, i.e., it can be further rewritten to and (and (= a b) (= b c)) (= c d).

OPERATION_NAME = 'smt.eq'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.eq(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ExistsOp(result, num_patterns, *, weight=None, noPattern=None, boundVarNames=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents the exists quantifier as described in the SMT-LIB 2.7 standard. It is part of the language itself rather than a theory or logic.

The operation specifies the name prefixes (as an optional attribute) and types (as the types of the block arguments of the regions) of bound variables that may be used in the ‘body’ of the operation. If a ‘patterns’ region is specified, the block arguments must match the ones of the ‘body’ region and (other than there) must be used at least once in the ‘patterns’ region. It may also not contain any operations that bind variables, such as quantifiers. While the ‘body’ region must always yield exactly one !smt.bool-typed value, the ‘patterns’ region can yield an arbitrary number (but at least one) of SMT values.

The bound variables can be any SMT type except of functions, since SMT only supports first-order logic.

The ‘no_patterns’ attribute is only allowed when no ‘patterns’ region is specified and forbids the solver to generate and use patterns for this quantifier.

The ‘weight’ attribute indicates the importance of this quantifier being instantiated compared to other quantifiers that may be present. The default value is zero.

Both the ‘no_patterns’ and ‘weight’ attributes are annotations to the quantifiers body term. Annotations and attributes are described in the standard in sections 3.4, and 3.6 (specifically 3.6.5). SMT-LIB allows adding custom attributes to provide solvers with additional metadata, e.g., hints such as above mentioned attributes. They are not part of the standard themselves, but supported by common SMT solvers (e.g., Z3).

OPERATION_NAME = 'smt.exists'
_ODS_REGIONS = (1, False)
weight() _ods_ir
noPattern() bool
boundVarNames() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

body() _ods_ir
patterns() _ods_ir
mlir.dialects._smt_ops_gen.exists(result, num_patterns, *, weight=None, no_pattern=None, bound_var_names=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ExtractOp(result, lowBit, input, *, loc=None, ip=None)

Bases: _ods_ir

This operation extracts the range of bits starting at the ‘lowBit’ index (inclusive) up to the ‘lowBit’ + result-width index (exclusive). The semantics are equivalent to the extract operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

Note that smt.bv.extract %bv from 2 : (!smt.bv<32>) -> !smt.bv<16> is equivalent to ((_ extract 17 2) bv), i.e., the SMT-LIB operator takes the low and high indices where both are inclusive. The following equivalence holds: (= ((_ extract 3 0) #x0f) #xf)

OPERATION_NAME = 'smt.bv.extract'
_ODS_REGIONS = (0, True)
input() _ods_ir
lowBit() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_extract(result, low_bit, input, *, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ForallOp(result, num_patterns, *, weight=None, noPattern=None, boundVarNames=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents the forall quantifier as described in the SMT-LIB 2.7 standard. It is part of the language itself rather than a theory or logic.

The operation specifies the name prefixes (as an optional attribute) and types (as the types of the block arguments of the regions) of bound variables that may be used in the ‘body’ of the operation. If a ‘patterns’ region is specified, the block arguments must match the ones of the ‘body’ region and (other than there) must be used at least once in the ‘patterns’ region. It may also not contain any operations that bind variables, such as quantifiers. While the ‘body’ region must always yield exactly one !smt.bool-typed value, the ‘patterns’ region can yield an arbitrary number (but at least one) of SMT values.

The bound variables can be any SMT type except of functions, since SMT only supports first-order logic.

The ‘no_patterns’ attribute is only allowed when no ‘patterns’ region is specified and forbids the solver to generate and use patterns for this quantifier.

The ‘weight’ attribute indicates the importance of this quantifier being instantiated compared to other quantifiers that may be present. The default value is zero.

Both the ‘no_patterns’ and ‘weight’ attributes are annotations to the quantifiers body term. Annotations and attributes are described in the standard in sections 3.4, and 3.6 (specifically 3.6.5). SMT-LIB allows adding custom attributes to provide solvers with additional metadata, e.g., hints such as above mentioned attributes. They are not part of the standard themselves, but supported by common SMT solvers (e.g., Z3).

OPERATION_NAME = 'smt.forall'
_ODS_REGIONS = (1, False)
weight() _ods_ir
noPattern() bool
boundVarNames() _ods_ir | None
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

body() _ods_ir
patterns() _ods_ir
mlir.dialects._smt_ops_gen.forall(result, num_patterns, *, weight=None, no_pattern=None, bound_var_names=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ImpliesOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a boolean implication. The semantics are equivalent to the ‘=>’ operator in the Core theory of the SMT-LIB Standard 2.7.

OPERATION_NAME = 'smt.implies'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.implies(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.Int2BVOp(result, input, *, loc=None, ip=None)

Bases: _ods_ir

Designed to lower directly to an operation of the same name in Z3. The Z3 C API describes the semantics as follows: Create an n bit bit-vector from the integer argument t1. The resulting bit-vector has n bits, where the i’th bit (counting from 0 to n-1) is 1 if (t1 div 2^i) mod 2 is 1. The node t1 must have integer sort.

OPERATION_NAME = 'smt.int2bv'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int2bv(result, input, *, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntAbsOp(input, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents the absolute value function for the Int sort. The semantics are equivalent to the abs operator as described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.abs'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_abs(input, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntAddOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer addition. The semantics are equivalent to the corresponding operator described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.add'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_add(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntCmpOp(pred, lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents the comparison of (infinite-precision) integers. The semantics are equivalent to the <= (le), < (lt), >= (ge), or > (gt) operator depending on the predicate (indicated in parentheses) as described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.cmp'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
pred() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_cmp(pred, lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntConstantOp(value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer literals of the Int sort. The set of values for the sort Int consists of all numerals and all terms of the form ``-n``where n is a numeral other than 0. For more information refer to the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.constant'
_ODS_REGIONS = (0, True)
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_constant(value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntDivOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer division. The semantics are equivalent to the corresponding operator described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.div'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_div(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntModOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer remainder. The semantics are equivalent to the corresponding operator described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.mod'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_mod(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntMulOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer multiplication. The semantics are equivalent to the corresponding operator described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.mul'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_mul(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IntSubOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation represents (infinite-precision) integer subtraction. The semantics are equivalent to the corresponding operator described in the SMT Ints theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.int.sub'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.int_sub(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.IteOp(cond, thenValue, elseValue, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation returns its second operand or its third operand depending on whether its first operand is true or not. The semantics are equivalent to the ite operator defined in the Core theory of the SMT-LIB 2.7 standard.

OPERATION_NAME = 'smt.ite'
_ODS_REGIONS = (0, True)
cond() _ods_ir
thenValue() _ods_ir
elseValue() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.ite(cond, then_value, else_value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.NotOp(input, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a boolean negation. The semantics are equivalent to the ‘not’ operator in the Core theory of the SMT-LIB Standard 2.7.

OPERATION_NAME = 'smt.not'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.not_(input, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.OrOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a boolean disjunction. The semantics are equivalent to the ‘or’ operator in the Core theory. of the SMT-LIB Standard 2.7.

It supports a variadic number of operands, but requires at least two.
This is because the operator is annotated with the `:left-assoc` attribute
which means that `op a b c` is equivalent to `(op (op a b) c)`.
OPERATION_NAME = 'smt.or'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.or_(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.PopOp(count, *, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.pop'
_ODS_REGIONS = (0, True)
count() _ods_ir
mlir.dialects._smt_ops_gen.pop(count, *, loc=None, ip=None) PopOp
class mlir.dialects._smt_ops_gen.PushOp(count, *, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.push'
_ODS_REGIONS = (0, True)
count() _ods_ir
mlir.dialects._smt_ops_gen.push(count, *, loc=None, ip=None) PushOp
class mlir.dialects._smt_ops_gen.RepeatOp(result, input, *, loc=None, ip=None)

Bases: _ods_ir

This operation is a shorthand for repeated concatenation of the same bit-vector value, i.e.,

smt.bv.repeat 5 times %a : !smt.bv<4>
// is the same as
%0 = smt.bv.repeat 4 times %a : !smt.bv<4>
smt.bv.concat %a, %0 : !smt.bv<4>, !smt.bv<16>
// or also
%0 = smt.bv.repeat 4 times %a : !smt.bv<4>
smt.bv.concat %0, %a : !smt.bv<16>, !smt.bv<4>

The semantics are equivalent to the repeat operator defined in the SMT-LIB 2.7 standard. More precisely in the theory of FixedSizeBitVectors and the QF_BV logic describing closed quantifier-free formulas over the theory of fixed-size bit-vectors.

OPERATION_NAME = 'smt.bv.repeat'
_ODS_REGIONS = (0, True)
input() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.bv_repeat(result, input, *, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.ResetOp(*, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.reset'
_ODS_REGIONS = (0, True)
mlir.dialects._smt_ops_gen.reset(*, loc=None, ip=None) ResetOp
class mlir.dialects._smt_ops_gen.SetLogicOp(logic, *, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.set_logic'
_ODS_REGIONS = (0, True)
logic() _ods_ir
mlir.dialects._smt_ops_gen.set_logic(logic, *, loc=None, ip=None) SetLogicOp
class mlir.dialects._smt_ops_gen.SolverOp(results_, inputs, *, loc=None, ip=None)

Bases: _ods_ir

This operation defines an SMT context with a solver instance. SMT operations are only valid when being executed between the start and end of the region of this operation. Any invocation outside is undefined. However, they do not have to be direct children of this operation. For example, it is allowed to have SMT operations in a func.func which is only called from within this region. No SMT value may enter or exit the lifespan of this region (such that no value created from another SMT context can be used in this scope and the solver can deallocate all state required to keep track of SMT values at the end).

As a result, the region is comparable to an entire SMT-LIB script, but allows for concrete operations and control-flow. Concrete values may be passed in and returned to influence the computations after the smt.solver operation.

Example:

%0:2 = smt.solver (%in) {smt.some_attr} : (i8) -> (i8, i32) {
^bb0(%arg0: i8):
  %c = smt.declare_fun "c" : !smt.bool
  smt.assert %c
  %1 = smt.check sat {
    %c1_i32 = arith.constant 1 : i32
    smt.yield %c1_i32 : i32
  } unknown {
    %c0_i32 = arith.constant 0 : i32
    smt.yield %c0_i32 : i32
  } unsat {
    %c-1_i32 = arith.constant -1 : i32
    smt.yield %c-1_i32 : i32
  } -> i32
  smt.yield %arg0, %1 : i8, i32
}
OPERATION_NAME = 'smt.solver'
_ODS_REGIONS = (1, True)
inputs() _ods_ir
results_() _ods_ir
bodyRegion() _ods_ir
mlir.dialects._smt_ops_gen.solver(results_, inputs, *, loc=None, ip=None) _ods_ir | _ods_ir | SolverOp
class mlir.dialects._smt_ops_gen.XOrOp(inputs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

This operation performs a boolean exclusive OR. The semantics are equivalent to the ‘xor’ operator in the Core theory. of the SMT-LIB Standard 2.7.

It supports a variadic number of operands, but requires at least two.
This is because the operator is annotated with the `:left-assoc` attribute
which means that `op a b c` is equivalent to `(op (op a b) c)`.
OPERATION_NAME = 'smt.xor'
_ODS_REGIONS = (0, True)
inputs() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

mlir.dialects._smt_ops_gen.xor(inputs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._smt_ops_gen.YieldOp(values, *, loc=None, ip=None)

Bases: _ods_ir

OPERATION_NAME = 'smt.yield'
_ODS_REGIONS = (0, True)
values() _ods_ir
mlir.dialects._smt_ops_gen.yield_(values, *, loc=None, ip=None) YieldOp