mlir.dialects._smt_ops_gen¶
Attributes¶
Classes¶
This operation performs a boolean conjunction. |
|
This operation performs a function application as described in the |
|
This operation represents a broadcast of the 'value' operand to all indices |
|
This operation is retuns the value stored in the given array at the given |
|
This operation returns a new array which is the same as the 'array' operand |
|
Create an integer from the bit-vector argument |
|
This operation performs arithmetic shift right. The semantics are |
|
This operation performs addition. The semantics are |
|
This operation performs bitwise AND. The semantics are |
|
This operation compares bit-vector values, interpreting them as signed or |
|
This operation produces an SSA value equal to the bit-vector constant |
|
This operation performs logical shift right. The semantics are |
|
This operation performs multiplication. The semantics are |
|
This operation performs two's complement unary minus. The semantics are |
|
This operation performs bitwise negation. The semantics are |
|
This operation performs bitwise OR. The semantics are |
|
This operation performs two's complement signed division. The semantics are |
|
This operation performs two's complement signed remainder (sign follows divisor). The semantics are |
|
This operation performs two's complement signed remainder (sign follows dividend). The semantics are |
|
This operation performs shift left. The semantics are |
|
This operation performs unsigned division (rounded towards zero). The semantics are |
|
This operation performs unsigned remainder. The semantics are |
|
This operation performs bitwise exclusive OR. The semantics are |
|
Produces the constant expressions 'true' and 'false' as described in the |
|
This operation checks if all the assertions in the solver defined by the |
|
This operation concatenates bit-vector values with semantics equivalent to |
|
This operation declares a symbolic value just as the |
|
This operation compares the operands and returns true iff all operands are |
|
This operation compares the operands and returns true iff all operands are |
|
This operation represents the exists quantifier as described in the |
|
This operation extracts the range of bits starting at the 'lowBit' index |
|
This operation represents the forall quantifier as described in the |
|
This operation performs a boolean implication. The semantics are equivalent |
|
Designed to lower directly to an operation of the same name in Z3. The Z3 |
|
This operation represents the absolute value function for the |
|
This operation represents (infinite-precision) integer addition. |
|
This operation represents the comparison of (infinite-precision) integers. |
|
This operation represents (infinite-precision) integer literals of the |
|
This operation represents (infinite-precision) integer division. |
|
This operation represents (infinite-precision) integer remainder. |
|
This operation represents (infinite-precision) integer multiplication. |
|
This operation represents (infinite-precision) integer subtraction. |
|
This operation returns its second operand or its third operand depending on |
|
This operation performs a boolean negation. The semantics are equivalent to |
|
This operation performs a boolean disjunction. |
|
This operation is a shorthand for repeated concatenation of the same |
|
This operation defines an SMT context with a solver instance. SMT operations |
|
This operation performs a boolean exclusive OR. |
|
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_irThis 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_irThis 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_irThis 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 %0In 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_irThis operation is retuns the value stored in the given array at the given index. The semantics are equivalent to the
selectoperator 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_irThis 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¶
- class mlir.dialects._smt_ops_gen.BV2IntOp(input, *, is_signed=None, results=None, loc=None, ip=None)¶
Bases:
_ods_irCreate an integer from the bit-vector argument
input. Ifis_signedis 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 ininput.- 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_irThis operation performs arithmetic shift right. The semantics are equivalent to the
bvashroperator 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_irThis operation performs addition. The semantics are equivalent to the
bvaddoperator 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_irThis operation performs bitwise AND. The semantics are equivalent to the
bvandoperator 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_irThis 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, orbvugeoperator 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_irThis operation produces an SSA value equal to the bit-vector constant specified by the ‘value’ attribute. Refer to the
BitVectorAttrdocumentation 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_irThis operation performs logical shift right. The semantics are equivalent to the
bvlshroperator 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_irThis operation performs multiplication. The semantics are equivalent to the
bvmuloperator 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_irThis operation performs two’s complement unary minus. The semantics are equivalent to the
bvnegoperator 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_irThis operation performs bitwise negation. The semantics are equivalent to the
bvnotoperator 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_irThis operation performs bitwise OR. The semantics are equivalent to the
bvoroperator 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_irThis operation performs two’s complement signed division. The semantics are equivalent to the
bvsdivoperator 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_irThis operation performs two’s complement signed remainder (sign follows divisor). The semantics are equivalent to the
bvsmodoperator 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_irThis operation performs two’s complement signed remainder (sign follows dividend). The semantics are equivalent to the
bvsremoperator 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_irThis operation performs shift left. The semantics are equivalent to the
bvshloperator 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_irThis operation performs unsigned division (rounded towards zero). The semantics are equivalent to the
bvudivoperator 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_irThis operation performs unsigned remainder. The semantics are equivalent to the
bvuremoperator 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_irThis operation performs bitwise exclusive OR. The semantics are equivalent to the
bvxoroperator 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_irProduces 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_irThis operation checks if all the assertions in the solver defined by the nearest ancestor operation of type
smt.solverare consistent. The outcome an be ‘satisfiable’, ‘unknown’, or ‘unsatisfiable’ and the corresponding region will be executed. It is the corresponding construct to thecheck-satin 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¶
- class mlir.dialects._smt_ops_gen.ConcatOp(lhs, rhs, *, results=None, loc=None, ip=None)¶
Bases:
_ods_irThis operation concatenates bit-vector values with semantics equivalent to the
concatoperator 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_irThis operation declares a symbolic value just as the
declare-constanddeclare-funstatements 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
declarewill 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-funsince(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 %0Note 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_irThis 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
distinctoperator 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
distinctoperator is annotated with:pairwisewhich means thatdistinct a b c dis equivalent toand (distinct a b) (distinct a c) (distinct a d) (distinct b c) (distinct b d) (distinct c d)
where
andis 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_irThis 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:chainablewhich means that= a b c dis equivalent toand (= a b) (= b c) (= c d)whereandis annotated:left-assoc, i.e., it can be further rewritten toand (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_irThis 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_irThis 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
extractoperator 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_irThis 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_irThis 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_irDesigned 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_irThis operation represents the absolute value function for the
Intsort. The semantics are equivalent to theabsoperator 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_irThis 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_irThis 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_irThis operation represents (infinite-precision) integer literals of the
Intsort. The set of values for the sortIntconsists 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_irThis 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_irThis 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_irThis 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_irThis 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_irThis 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
iteoperator 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_irThis 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_irThis 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¶
- 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¶
- class mlir.dialects._smt_ops_gen.RepeatOp(result, input, *, loc=None, ip=None)¶
Bases:
_ods_irThis 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
repeatoperator 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)¶
- 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_irThis 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.funcwhich 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.solveroperation.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_irThis 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¶