Skip to content

Smt

smt

NonFuncSMTType: TypeAlias = BoolType | BitVectorType module-attribute

NonFuncSMTTypeConstr = irdl_to_attr_constraint(NonFuncSMTType) module-attribute

SMTType: TypeAlias = NonFuncSMTType | FuncType module-attribute

SMTTypeConstr = irdl_to_attr_constraint(SMTType) module-attribute

SMT = Dialect('smt', [DeclareFunOp, ApplyFuncOp, ConstantBoolOp, NotOp, AndOp, OrOp, XOrOp, ImpliesOp, DistinctOp, EqOp, IteOp, ExistsOp, ForallOp, YieldOp, AssertOp, BvConstantOp, BVNegOp, BVNotOp, BVAndOp, BVOrOp, BVXOrOp, BVAddOp, BVMulOp, BVUDivOp, BVSDivOp, BVURemOp, BVSRemOp, BVSModOp, BVShlOp, BVLShrOp, BVAShrOp], [BoolType, BitVectorType, FuncType, BitVectorAttr]) module-attribute

BoolType dataclass

Bases: ParametrizedAttribute, TypeAttribute

A boolean.

Source code in xdsl/dialects/smt.py
49
50
51
52
53
@irdl_attr_definition
class BoolType(ParametrizedAttribute, TypeAttribute):
    """A boolean."""

    name = "smt.bool"

name = 'smt.bool' class-attribute instance-attribute

BitVectorType

Bases: ParametrizedAttribute, TypeAttribute

This type represents the (_ BitVec width) sort as described in the SMT bitvector theory. The bit-width must be strictly greater than zero.

Source code in xdsl/dialects/smt.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@irdl_attr_definition
class BitVectorType(ParametrizedAttribute, TypeAttribute):
    """
    This type represents the (_ BitVec width) sort as described in the SMT bitvector theory.
    The bit-width must be strictly greater than zero.
    """

    name = "smt.bv"

    width: IntAttr

    def __init__(self, width: int | IntAttr):
        if isinstance(width, int):
            width = IntAttr(width)
        super().__init__(width)

    @classmethod
    def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
        with parser.in_angle_brackets():
            width = parser.parse_integer(allow_boolean=False, allow_negative=False)

        return (IntAttr(width),)

    def print_parameters(self, printer: Printer) -> None:
        printer.print_string(f"<{self.width.data}>")

    def verify(self) -> None:
        super().verify()
        if self.width.data <= 0:
            raise VerifyException(
                "BitVectorType width must be strictly greater "
                f"than zero, got {self.width.data}"
            )

    def value_range(self) -> tuple[int, int]:
        """
        The range of values that this bitvector can represent.
        The maximum value is exclusive.
        """
        return (0, 1 << self.width.data)

name = 'smt.bv' class-attribute instance-attribute

width: IntAttr instance-attribute

__init__(width: int | IntAttr)

Source code in xdsl/dialects/smt.py
67
68
69
70
def __init__(self, width: int | IntAttr):
    if isinstance(width, int):
        width = IntAttr(width)
    super().__init__(width)

parse_parameters(parser: AttrParser) -> Sequence[Attribute] classmethod

Source code in xdsl/dialects/smt.py
72
73
74
75
76
77
@classmethod
def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
    with parser.in_angle_brackets():
        width = parser.parse_integer(allow_boolean=False, allow_negative=False)

    return (IntAttr(width),)

print_parameters(printer: Printer) -> None

Source code in xdsl/dialects/smt.py
79
80
def print_parameters(self, printer: Printer) -> None:
    printer.print_string(f"<{self.width.data}>")

verify() -> None

Source code in xdsl/dialects/smt.py
82
83
84
85
86
87
88
def verify(self) -> None:
    super().verify()
    if self.width.data <= 0:
        raise VerifyException(
            "BitVectorType width must be strictly greater "
            f"than zero, got {self.width.data}"
        )

value_range() -> tuple[int, int]

The range of values that this bitvector can represent. The maximum value is exclusive.

Source code in xdsl/dialects/smt.py
90
91
92
93
94
95
def value_range(self) -> tuple[int, int]:
    """
    The range of values that this bitvector can represent.
    The maximum value is exclusive.
    """
    return (0, 1 << self.width.data)

FuncType

Bases: ParametrizedAttribute, TypeAttribute

A function type.

Source code in xdsl/dialects/smt.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@irdl_attr_definition
class FuncType(ParametrizedAttribute, TypeAttribute):
    """A function type."""

    name = "smt.func"

    domain_types: ArrayAttr[NonFuncSMTType]
    """The types of the function arguments."""

    range_type: NonFuncSMTType
    """The type of the function result."""

    def __init__(
        self, domain_types: Sequence[NonFuncSMTType], range_type: NonFuncSMTType
    ):
        super().__init__(ArrayAttr[NonFuncSMTType](domain_types), range_type)

    @classmethod
    def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
        with parser.in_angle_brackets():
            domain_types = parser.parse_comma_separated_list(
                parser.Delimiter.PAREN, parser.parse_type
            )
            range_type = parser.parse_type()

        return (ArrayAttr(domain_types), range_type)

    def print_parameters(self, printer: Printer) -> None:
        printer.print_string("<(")
        printer.print_list(self.domain_types, printer.print_attribute)
        printer.print_string(") ")
        printer.print_attribute(self.range_type)
        printer.print_string(">")

    @staticmethod
    def constr(
        domain: RangeConstraint[NonFuncSMTType],
        range: AttrConstraint[NonFuncSMTType],
    ) -> AttrConstraint[FuncType]:
        return ParamAttrConstraint(FuncType, (ArrayAttr.constr(domain), range))

name = 'smt.func' class-attribute instance-attribute

domain_types: ArrayAttr[NonFuncSMTType] instance-attribute

The types of the function arguments.

range_type: NonFuncSMTType instance-attribute

The type of the function result.

__init__(domain_types: Sequence[NonFuncSMTType], range_type: NonFuncSMTType)

Source code in xdsl/dialects/smt.py
114
115
116
117
def __init__(
    self, domain_types: Sequence[NonFuncSMTType], range_type: NonFuncSMTType
):
    super().__init__(ArrayAttr[NonFuncSMTType](domain_types), range_type)

parse_parameters(parser: AttrParser) -> Sequence[Attribute] classmethod

Source code in xdsl/dialects/smt.py
119
120
121
122
123
124
125
126
127
@classmethod
def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
    with parser.in_angle_brackets():
        domain_types = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, parser.parse_type
        )
        range_type = parser.parse_type()

    return (ArrayAttr(domain_types), range_type)

print_parameters(printer: Printer) -> None

Source code in xdsl/dialects/smt.py
129
130
131
132
133
134
def print_parameters(self, printer: Printer) -> None:
    printer.print_string("<(")
    printer.print_list(self.domain_types, printer.print_attribute)
    printer.print_string(") ")
    printer.print_attribute(self.range_type)
    printer.print_string(">")

constr(domain: RangeConstraint[NonFuncSMTType], range: AttrConstraint[NonFuncSMTType]) -> AttrConstraint[FuncType] staticmethod

Source code in xdsl/dialects/smt.py
136
137
138
139
140
141
@staticmethod
def constr(
    domain: RangeConstraint[NonFuncSMTType],
    range: AttrConstraint[NonFuncSMTType],
) -> AttrConstraint[FuncType]:
    return ParamAttrConstraint(FuncType, (ArrayAttr.constr(domain), range))

BitVectorAttr

Bases: TypedAttribute

Source code in xdsl/dialects/smt.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@irdl_attr_definition
class BitVectorAttr(TypedAttribute):
    name = "smt.bv"

    value: IntAttr
    type: BitVectorType

    def __init__(self, value: int | IntAttr, type: BitVectorType | int):
        if isinstance(value, int):
            value = IntAttr(value)
        if isinstance(type, int):
            type = BitVectorType(type)
        super().__init__(value, type)

    def verify(self) -> None:
        super().verify()
        (min_value, max_value) = self.type.value_range()
        if not (min_value <= self.value.data < max_value):
            raise VerifyException(
                f"BitVectorAttr value {self.value.data} is out of range "
                f"[{min_value}, {max_value}) for type {self.type}"
            )

    @staticmethod
    def constr(
        type: AttrConstraint[BitVectorType],
    ) -> AttrConstraint[BitVectorAttr]:
        return ParamAttrConstraint(
            BitVectorAttr,
            (
                AnyAttr(),
                type,
            ),
        )

    @classmethod
    def get_type_index(cls) -> int:
        return 1

    @classmethod
    def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
        with parser.in_angle_brackets():
            value = parser.parse_integer(allow_boolean=False, allow_negative=False)
        parser.parse_punctuation(":")
        type = parser.parse_type()
        return [IntAttr(value), type]

    def print_parameters(self, printer: Printer) -> None:
        printer.print_string(f"<{self.value.data}> : {self.type}")

    @staticmethod
    def parse_with_type(
        parser: AttrParser,
        type: Attribute,
    ) -> TypedAttribute:
        with parser.in_angle_brackets():
            value = parser.parse_integer(allow_boolean=False, allow_negative=False)
        return BitVectorAttr.new([IntAttr(value), type])

    def print_without_type(self, printer: Printer) -> None:
        printer.print_string(f"<{self.value.data}>")

name = 'smt.bv' class-attribute instance-attribute

value: IntAttr instance-attribute

type: BitVectorType instance-attribute

__init__(value: int | IntAttr, type: BitVectorType | int)

Source code in xdsl/dialects/smt.py
155
156
157
158
159
160
def __init__(self, value: int | IntAttr, type: BitVectorType | int):
    if isinstance(value, int):
        value = IntAttr(value)
    if isinstance(type, int):
        type = BitVectorType(type)
    super().__init__(value, type)

verify() -> None

Source code in xdsl/dialects/smt.py
162
163
164
165
166
167
168
169
def verify(self) -> None:
    super().verify()
    (min_value, max_value) = self.type.value_range()
    if not (min_value <= self.value.data < max_value):
        raise VerifyException(
            f"BitVectorAttr value {self.value.data} is out of range "
            f"[{min_value}, {max_value}) for type {self.type}"
        )

constr(type: AttrConstraint[BitVectorType]) -> AttrConstraint[BitVectorAttr] staticmethod

Source code in xdsl/dialects/smt.py
171
172
173
174
175
176
177
178
179
180
181
@staticmethod
def constr(
    type: AttrConstraint[BitVectorType],
) -> AttrConstraint[BitVectorAttr]:
    return ParamAttrConstraint(
        BitVectorAttr,
        (
            AnyAttr(),
            type,
        ),
    )

get_type_index() -> int classmethod

Source code in xdsl/dialects/smt.py
183
184
185
@classmethod
def get_type_index(cls) -> int:
    return 1

parse_parameters(parser: AttrParser) -> Sequence[Attribute] classmethod

Source code in xdsl/dialects/smt.py
187
188
189
190
191
192
193
@classmethod
def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
    with parser.in_angle_brackets():
        value = parser.parse_integer(allow_boolean=False, allow_negative=False)
    parser.parse_punctuation(":")
    type = parser.parse_type()
    return [IntAttr(value), type]

print_parameters(printer: Printer) -> None

Source code in xdsl/dialects/smt.py
195
196
def print_parameters(self, printer: Printer) -> None:
    printer.print_string(f"<{self.value.data}> : {self.type}")

parse_with_type(parser: AttrParser, type: Attribute) -> TypedAttribute staticmethod

Source code in xdsl/dialects/smt.py
198
199
200
201
202
203
204
205
@staticmethod
def parse_with_type(
    parser: AttrParser,
    type: Attribute,
) -> TypedAttribute:
    with parser.in_angle_brackets():
        value = parser.parse_integer(allow_boolean=False, allow_negative=False)
    return BitVectorAttr.new([IntAttr(value), type])

print_without_type(printer: Printer) -> None

Source code in xdsl/dialects/smt.py
207
208
def print_without_type(self, printer: Printer) -> None:
    printer.print_string(f"<{self.value.data}>")

DeclareFunOp

Bases: IRDLOperation

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.

Source code in xdsl/dialects/smt.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
@irdl_op_definition
class DeclareFunOp(IRDLOperation):
    """
    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.
    """

    name = "smt.declare_fun"

    name_prefix = opt_prop_def(StringAttr, prop_name="namePrefix")
    result = result_def(SMTType)

    assembly_format = "($namePrefix^)? attr-dict `:` type($result)"

    def __init__(
        self, result_type: SMTType, name_prefix: StringAttr | str | None = None
    ):
        if isinstance(name_prefix, str):
            name_prefix = StringAttr(name_prefix)
        super().__init__(
            result_types=[result_type], properties={"namePrefix": name_prefix}
        )

name = 'smt.declare_fun' class-attribute instance-attribute

name_prefix = opt_prop_def(StringAttr, prop_name='namePrefix') class-attribute instance-attribute

result = result_def(SMTType) class-attribute instance-attribute

assembly_format = '($namePrefix^)? attr-dict `:` type($result)' class-attribute instance-attribute

__init__(result_type: SMTType, name_prefix: StringAttr | str | None = None)

Source code in xdsl/dialects/smt.py
232
233
234
235
236
237
238
239
def __init__(
    self, result_type: SMTType, name_prefix: StringAttr | str | None = None
):
    if isinstance(name_prefix, str):
        name_prefix = StringAttr(name_prefix)
    super().__init__(
        result_types=[result_type], properties={"namePrefix": name_prefix}
    )

ApplyFuncOp

Bases: IRDLOperation

This operation performs a function application as described in the SMT-LIB 2.7 standard. It is part of the SMT-LIB core theory.

Source code in xdsl/dialects/smt.py
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
@irdl_op_definition
class ApplyFuncOp(IRDLOperation):
    """
    This operation performs a function application as described in the SMT-LIB
    2.7 standard. It is part of the SMT-LIB core theory.
    """

    name = "smt.apply_func"

    DOMAIN: ClassVar = RangeVarConstraint("DOMAIN", RangeOf(NonFuncSMTTypeConstr))
    RANGE: ClassVar = VarConstraint("RANGE", NonFuncSMTTypeConstr)

    func = operand_def(FuncType.constr(DOMAIN, RANGE))
    args = var_operand_def(DOMAIN)

    result = result_def(RANGE)

    assembly_format = "$func `(` $args `)` attr-dict `:` type($func)"

    def __init__(self, func: SSAValue[FuncType], *args: SSAValue):
        super().__init__(
            operands=[func, tuple(args)], result_types=[func.type.range_type]
        )

name = 'smt.apply_func' class-attribute instance-attribute

DOMAIN: ClassVar = RangeVarConstraint('DOMAIN', RangeOf(NonFuncSMTTypeConstr)) class-attribute instance-attribute

RANGE: ClassVar = VarConstraint('RANGE', NonFuncSMTTypeConstr) class-attribute instance-attribute

func = operand_def(FuncType.constr(DOMAIN, RANGE)) class-attribute instance-attribute

args = var_operand_def(DOMAIN) class-attribute instance-attribute

result = result_def(RANGE) class-attribute instance-attribute

assembly_format = '$func `(` $args `)` attr-dict `:` type($func)' class-attribute instance-attribute

__init__(func: SSAValue[FuncType], *args: SSAValue)

Source code in xdsl/dialects/smt.py
261
262
263
264
def __init__(self, func: SSAValue[FuncType], *args: SSAValue):
    super().__init__(
        operands=[func, tuple(args)], result_types=[func.type.range_type]
    )

ConstantBoolOp

Bases: IRDLOperation, ConstantLikeInterface

This operation represents a constant boolean value. The semantics are equivalent to the ‘true’ and ‘false’ keywords in the Core theory of the SMT-LIB Standard 2.7.

Source code in xdsl/dialects/smt.py
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
@irdl_op_definition
class ConstantBoolOp(IRDLOperation, ConstantLikeInterface):
    """
    This operation represents a constant boolean value. The semantics are
    equivalent to the ‘true’ and ‘false’ keywords in the Core theory of the
    SMT-LIB Standard 2.7.
    """

    name = "smt.constant"

    value_attr = prop_def(BoolAttr, prop_name="value")
    result = result_def(BoolType())

    traits = traits_def(Pure())

    assembly_format = "qualified($value) attr-dict"

    def __init__(self, value: bool):
        value_attr = BoolAttr.from_bool(value)
        super().__init__(properties={"value": value_attr}, result_types=[BoolType()])

    @property
    def value(self) -> bool:
        return bool(self.value_attr)

    def get_constant_value(self) -> Attribute:
        return self.value_attr

name = 'smt.constant' class-attribute instance-attribute

value_attr = prop_def(BoolAttr, prop_name='value') class-attribute instance-attribute

result = result_def(BoolType()) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = 'qualified($value) attr-dict' class-attribute instance-attribute

value: bool property

__init__(value: bool)

Source code in xdsl/dialects/smt.py
284
285
286
def __init__(self, value: bool):
    value_attr = BoolAttr.from_bool(value)
    super().__init__(properties={"value": value_attr}, result_types=[BoolType()])

get_constant_value() -> Attribute

Source code in xdsl/dialects/smt.py
292
293
def get_constant_value(self) -> Attribute:
    return self.value_attr

NotOp

Bases: IRDLOperation

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.

Source code in xdsl/dialects/smt.py
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
@irdl_op_definition
class NotOp(IRDLOperation):
    """
    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.
    """

    name = "smt.not"

    input = operand_def(BoolType)
    result = result_def(BoolType)

    assembly_format = "$input attr-dict"

    traits = traits_def(Pure())

    def __init__(self, input: SSAValue):
        super().__init__(operands=[input], result_types=[BoolType()])

name = 'smt.not' class-attribute instance-attribute

input = operand_def(BoolType) class-attribute instance-attribute

result = result_def(BoolType) class-attribute instance-attribute

assembly_format = '$input attr-dict' class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(input: SSAValue)

Source code in xdsl/dialects/smt.py
312
313
def __init__(self, input: SSAValue):
    super().__init__(operands=[input], result_types=[BoolType()])

VariadicBoolOp

Bases: IRDLOperation

A variadic operation on boolean. It has a variadic number of operands, but requires at least two.

Source code in xdsl/dialects/smt.py
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
class VariadicBoolOp(IRDLOperation):
    """
    A variadic operation on boolean. It has a variadic number of operands, but
    requires at least two.
    """

    inputs = var_operand_def(RangeOf(base(BoolType)).of_length(AtLeast(2)))
    result = result_def(BoolType())

    traits = traits_def(Pure())

    assembly_format = "$inputs attr-dict"

    def __init__(self, *operands: SSAValue):
        super().__init__(operands=[operands], result_types=[BoolType()])

inputs = var_operand_def(RangeOf(base(BoolType)).of_length(AtLeast(2))) class-attribute instance-attribute

result = result_def(BoolType()) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$inputs attr-dict' class-attribute instance-attribute

__init__(*operands: SSAValue)

Source code in xdsl/dialects/smt.py
329
330
def __init__(self, *operands: SSAValue):
    super().__init__(operands=[operands], result_types=[BoolType()])

AndOp dataclass

Bases: VariadicBoolOp

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.

Source code in xdsl/dialects/smt.py
333
334
335
336
337
338
339
340
341
342
@irdl_op_definition
class AndOp(VariadicBoolOp):
    """
    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.
    """

    name = "smt.and"

name = 'smt.and' class-attribute instance-attribute

OrOp dataclass

Bases: VariadicBoolOp

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.

Source code in xdsl/dialects/smt.py
345
346
347
348
349
350
351
352
353
354
@irdl_op_definition
class OrOp(VariadicBoolOp):
    """
    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.
    """

    name = "smt.or"

name = 'smt.or' class-attribute instance-attribute

XOrOp dataclass

Bases: VariadicBoolOp

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.

Source code in xdsl/dialects/smt.py
357
358
359
360
361
362
363
364
365
366
@irdl_op_definition
class XOrOp(VariadicBoolOp):
    """
    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.
    """

    name = "smt.xor"

name = 'smt.xor' class-attribute instance-attribute

ImpliesOp

Bases: IRDLOperation

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

Source code in xdsl/dialects/smt.py
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
@irdl_op_definition
class ImpliesOp(IRDLOperation):
    """
    This operation performs a boolean implication. The semantics are equivalent
    to the `=>` operator in the Core theory of the SMT-LIB Standard 2.7.
    """

    name = "smt.implies"

    lhs = operand_def(BoolType)
    rhs = operand_def(BoolType)
    result = result_def(BoolType)

    traits = traits_def(Pure())

    assembly_format = "$lhs `,` $rhs attr-dict"

    def __init__(self, lhs: SSAValue, rhs: SSAValue):
        super().__init__(operands=[lhs, rhs], result_types=[BoolType()])

name = 'smt.implies' class-attribute instance-attribute

lhs = operand_def(BoolType) class-attribute instance-attribute

rhs = operand_def(BoolType) class-attribute instance-attribute

result = result_def(BoolType) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$lhs `,` $rhs attr-dict' class-attribute instance-attribute

__init__(lhs: SSAValue, rhs: SSAValue)

Source code in xdsl/dialects/smt.py
386
387
def __init__(self, lhs: SSAValue, rhs: SSAValue):
    super().__init__(operands=[lhs, rhs], result_types=[BoolType()])

VariadicPredicateOp

Bases: IRDLOperation, ABC

A predicate with a variadic number (but at least 2) operands.

Source code in xdsl/dialects/smt.py
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
class VariadicPredicateOp(IRDLOperation, ABC):
    """
    A predicate with a variadic number (but at least 2) operands.
    """

    T: ClassVar = VarConstraint("T", NonFuncSMTTypeConstr)

    inputs = var_operand_def(RangeOf(T).of_length(AtLeast(2)))
    result = result_def(BoolType())

    traits = traits_def(Pure())

    @classmethod
    def parse(cls: type[Self], parser: Parser) -> Self:
        operands, attr_dict = _parse_same_operand_type_variadic_to_bool_op(parser)
        op = cls(*operands)
        op.attributes = attr_dict
        return op

    def print(self, printer: Printer):
        _print_same_operand_type_variadic_to_bool_op(
            printer, self.inputs, self.attributes
        )

    def __init__(self, *operands: SSAValue):
        super().__init__(operands=[operands], result_types=[BoolType()])

T: ClassVar = VarConstraint('T', NonFuncSMTTypeConstr) class-attribute instance-attribute

inputs = var_operand_def(RangeOf(T).of_length(AtLeast(2))) class-attribute instance-attribute

result = result_def(BoolType()) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

parse(parser: Parser) -> Self classmethod

Source code in xdsl/dialects/smt.py
440
441
442
443
444
445
@classmethod
def parse(cls: type[Self], parser: Parser) -> Self:
    operands, attr_dict = _parse_same_operand_type_variadic_to_bool_op(parser)
    op = cls(*operands)
    op.attributes = attr_dict
    return op

print(printer: Printer)

Source code in xdsl/dialects/smt.py
447
448
449
450
def print(self, printer: Printer):
    _print_same_operand_type_variadic_to_bool_op(
        printer, self.inputs, self.attributes
    )

__init__(*operands: SSAValue)

Source code in xdsl/dialects/smt.py
452
453
def __init__(self, *operands: SSAValue):
    super().__init__(operands=[operands], result_types=[BoolType()])

DistinctOp dataclass

Bases: VariadicPredicateOp

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)
Source code in xdsl/dialects/smt.py
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
@irdl_op_definition
class DistinctOp(VariadicPredicateOp):
    """
    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)
    ```
    """

    name = "smt.distinct"

name = 'smt.distinct' class-attribute instance-attribute

EqOp dataclass

Bases: VariadicPredicateOp

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).

Source code in xdsl/dialects/smt.py
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
@irdl_op_definition
class EqOp(VariadicPredicateOp):
    """
    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)`.
    """

    name = "smt.eq"

name = 'smt.eq' class-attribute instance-attribute

IteOp

Bases: IRDLOperation

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.

Source code in xdsl/dialects/smt.py
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
@irdl_op_definition
class IteOp(IRDLOperation):
    """
    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.
    """

    name = "smt.ite"

    T: ClassVar = VarConstraint("T", NonFuncSMTTypeConstr)

    cond = operand_def(BoolType)
    then_value = operand_def(T)
    else_value = operand_def(T)

    result = result_def(T)

    assembly_format = (
        "$cond `,` $then_value `,` $else_value attr-dict `:` type($result)"
    )

    traits = traits_def(Pure())

    def __init__(self, cond: SSAValue, then_value: SSAValue, else_value: SSAValue):
        super().__init__(
            operands=[cond, then_value, else_value],
            result_types=[then_value.type],
        )

name = 'smt.ite' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', NonFuncSMTTypeConstr) class-attribute instance-attribute

cond = operand_def(BoolType) class-attribute instance-attribute

then_value = operand_def(T) class-attribute instance-attribute

else_value = operand_def(T) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

assembly_format = '$cond `,` $then_value `,` $else_value attr-dict `:` type($result)' class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(cond: SSAValue, then_value: SSAValue, else_value: SSAValue)

Source code in xdsl/dialects/smt.py
518
519
520
521
522
def __init__(self, cond: SSAValue, then_value: SSAValue, else_value: SSAValue):
    super().__init__(
        operands=[cond, then_value, else_value],
        result_types=[then_value.type],
    )

QuantifierOp

Bases: IRDLOperation, ABC

Source code in xdsl/dialects/smt.py
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
class QuantifierOp(IRDLOperation, ABC):
    result = result_def(BoolType)
    body = region_def("single_block")

    traits = traits_def(Pure())

    assembly_format = "attr-dict-with-keyword $body"

    def __init__(self, body: Region) -> None:
        super().__init__(result_types=[BoolType()], regions=[body])

    def verify_(self) -> None:
        if not isinstance(yield_op := self.body.block.last_op, YieldOp):
            raise VerifyException("region expects an `smt.yield` terminator")
        if tuple(yield_op.operand_types) != (BoolType(),):
            raise VerifyException(
                "region yield terminator must have a single boolean operand, "
                f"got {tuple(str(type) for type in yield_op.operand_types)}"
            )

    @property
    def returned_value(self) -> SSAValue[BoolType]:
        """
        The value returned by the quantifier. This is the value that is passed
        to the `smt.yield` terminator of the operation region.
        This function will asserts if the region is not correctly terminated by
        an `smt.yield` operation with a single boolean operand.
        """
        assert isinstance(yield_op := self.body.block.last_op, YieldOp)
        assert isa(ret_value := yield_op.values[0], SSAValue[BoolType])
        return ret_value

result = result_def(BoolType) class-attribute instance-attribute

body = region_def('single_block') class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = 'attr-dict-with-keyword $body' class-attribute instance-attribute

returned_value: SSAValue[BoolType] property

The value returned by the quantifier. This is the value that is passed to the smt.yield terminator of the operation region. This function will asserts if the region is not correctly terminated by an smt.yield operation with a single boolean operand.

__init__(body: Region) -> None

Source code in xdsl/dialects/smt.py
533
534
def __init__(self, body: Region) -> None:
    super().__init__(result_types=[BoolType()], regions=[body])

verify_() -> None

Source code in xdsl/dialects/smt.py
536
537
538
539
540
541
542
543
def verify_(self) -> None:
    if not isinstance(yield_op := self.body.block.last_op, YieldOp):
        raise VerifyException("region expects an `smt.yield` terminator")
    if tuple(yield_op.operand_types) != (BoolType(),):
        raise VerifyException(
            "region yield terminator must have a single boolean operand, "
            f"got {tuple(str(type) for type in yield_op.operand_types)}"
        )

ExistsOp dataclass

Bases: QuantifierOp

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.

Source code in xdsl/dialects/smt.py
558
559
560
561
562
563
564
565
@irdl_op_definition
class ExistsOp(QuantifierOp):
    """
    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.
    """

    name = "smt.exists"

name = 'smt.exists' class-attribute instance-attribute

ForallOp dataclass

Bases: QuantifierOp

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.

Source code in xdsl/dialects/smt.py
568
569
570
571
572
573
574
575
@irdl_op_definition
class ForallOp(QuantifierOp):
    """
    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.
    """

    name = "smt.forall"

name = 'smt.forall' class-attribute instance-attribute

YieldOp

Bases: IRDLOperation

Source code in xdsl/dialects/smt.py
578
579
580
581
582
583
584
585
586
587
588
589
@irdl_op_definition
class YieldOp(IRDLOperation):
    name = "smt.yield"

    values = var_operand_def(NonFuncSMTType)

    assembly_format = "($values^ `:` type($values))? attr-dict"

    traits = traits_def(IsTerminator(), HasParent(ExistsOp, ForallOp))

    def __init__(self, *values: SSAValue):
        super().__init__(operands=[values], result_types=[])

name = 'smt.yield' class-attribute instance-attribute

values = var_operand_def(NonFuncSMTType) class-attribute instance-attribute

assembly_format = '($values^ `:` type($values))? attr-dict' class-attribute instance-attribute

traits = traits_def(IsTerminator(), HasParent(ExistsOp, ForallOp)) class-attribute instance-attribute

__init__(*values: SSAValue)

Source code in xdsl/dialects/smt.py
588
589
def __init__(self, *values: SSAValue):
    super().__init__(operands=[values], result_types=[])

AssertOp

Bases: IRDLOperation

Assert that a boolean expression holds.

Source code in xdsl/dialects/smt.py
592
593
594
595
596
597
598
599
600
601
602
603
@irdl_op_definition
class AssertOp(IRDLOperation):
    """Assert that a boolean expression holds."""

    name = "smt.assert"

    input = operand_def(BoolType)

    assembly_format = "$input attr-dict"

    def __init__(self, input: SSAValue):
        super().__init__(operands=[input])

name = 'smt.assert' class-attribute instance-attribute

input = operand_def(BoolType) class-attribute instance-attribute

assembly_format = '$input attr-dict' class-attribute instance-attribute

__init__(input: SSAValue)

Source code in xdsl/dialects/smt.py
602
603
def __init__(self, input: SSAValue):
    super().__init__(operands=[input])

BvConstantOp

Bases: IRDLOperation, ConstantLikeInterface

This operation produces an SSA value equal to the bitvector constant specified by the ‘value’ attribute.

Source code in xdsl/dialects/smt.py
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
@irdl_op_definition
class BvConstantOp(IRDLOperation, ConstantLikeInterface):
    """
    This operation produces an SSA value equal to the bitvector constant specified
    by the ‘value’ attribute.
    """

    name = "smt.bv.constant"

    T: ClassVar = VarConstraint("T", base(BitVectorType))

    value = prop_def(BitVectorAttr.constr(T))
    result = result_def(T)

    assembly_format = "qualified($value) attr-dict"

    traits = traits_def(Pure())

    @overload
    def __init__(self, value: BitVectorAttr) -> None: ...

    @overload
    def __init__(self, value: int, type: BitVectorType | int) -> None: ...

    def __init__(
        self, value: BitVectorAttr | int, type: int | BitVectorType | None = None
    ):
        """
        Create a new `BvConstantOp` from a value and a bitvector width.
        """
        if not isinstance(value, BitVectorAttr):
            if isinstance(type, int):
                type = BitVectorType(type)
            assert isinstance(type, BitVectorType)
            value = BitVectorAttr(value, type)
        super().__init__(properties={"value": value}, result_types=[value.type])

    def get_constant_value(self) -> Attribute:
        return self.value

name = 'smt.bv.constant' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', base(BitVectorType)) class-attribute instance-attribute

value = prop_def(BitVectorAttr.constr(T)) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

assembly_format = 'qualified($value) attr-dict' class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(value: BitVectorAttr | int, type: int | BitVectorType | None = None)

__init__(value: BitVectorAttr) -> None
__init__(value: int, type: BitVectorType | int) -> None

Create a new BvConstantOp from a value and a bitvector width.

Source code in xdsl/dialects/smt.py
630
631
632
633
634
635
636
637
638
639
640
641
def __init__(
    self, value: BitVectorAttr | int, type: int | BitVectorType | None = None
):
    """
    Create a new `BvConstantOp` from a value and a bitvector width.
    """
    if not isinstance(value, BitVectorAttr):
        if isinstance(type, int):
            type = BitVectorType(type)
        assert isinstance(type, BitVectorType)
        value = BitVectorAttr(value, type)
    super().__init__(properties={"value": value}, result_types=[value.type])

get_constant_value() -> Attribute

Source code in xdsl/dialects/smt.py
643
644
def get_constant_value(self) -> Attribute:
    return self.value

UnaryBVOp

Bases: IRDLOperation, ABC

A unary bitvector operation. It has one operand and one result of the same bitvector type.

Source code in xdsl/dialects/smt.py
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
class UnaryBVOp(IRDLOperation, ABC):
    """
    A unary bitvector operation.
    It has one operand and one result of the same bitvector type.
    """

    T: ClassVar = VarConstraint("T", base(BitVectorType))

    input = operand_def(T)
    result = result_def(T)

    assembly_format = "$input attr-dict `:` type($result)"

    traits = traits_def(Pure())

    def __init__(self, input: SSAValue[BitVectorType]):
        super().__init__(operands=[input], result_types=[input.type])

T: ClassVar = VarConstraint('T', base(BitVectorType)) class-attribute instance-attribute

input = operand_def(T) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

assembly_format = '$input attr-dict `:` type($result)' class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(input: SSAValue[BitVectorType])

Source code in xdsl/dialects/smt.py
662
663
def __init__(self, input: SSAValue[BitVectorType]):
    super().__init__(operands=[input], result_types=[input.type])

BVNotOp dataclass

Bases: UnaryBVOp

A unary bitwise not operation for bitvectors. It corresponds to the 'not' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
666
667
668
669
670
671
672
673
@irdl_op_definition
class BVNotOp(UnaryBVOp):
    """
    A unary bitwise not operation for bitvectors.
    It corresponds to the 'not' operation in SMT-LIB.
    """

    name = "smt.bv.not"

name = 'smt.bv.not' class-attribute instance-attribute

BVNegOp dataclass

Bases: UnaryBVOp

A unary negation operation for bitvectors. It corresponds to the 'neg' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
676
677
678
679
680
681
682
683
@irdl_op_definition
class BVNegOp(UnaryBVOp):
    """
    A unary negation operation for bitvectors.
    It corresponds to the 'neg' operation in SMT-LIB.
    """

    name = "smt.bv.neg"

name = 'smt.bv.neg' class-attribute instance-attribute

BinaryBVOp

Bases: IRDLOperation, ABC

A binary bitvector operation. It has two operands and one result of the same bitvector type.

Source code in xdsl/dialects/smt.py
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
class BinaryBVOp(IRDLOperation, ABC):
    """
    A binary bitvector operation.
    It has two operands and one result of the same bitvector type.
    """

    T: ClassVar = VarConstraint("T", base(BitVectorType))

    lhs = operand_def(T)
    rhs = operand_def(T)
    result = result_def(T)

    assembly_format = "$lhs `,` $rhs attr-dict `:` type($result)"

    traits = traits_def(Pure())

    def __init__(self, lhs: SSAValue[BitVectorType], rhs: SSAValue[BitVectorType]):
        super().__init__(operands=[lhs, rhs], result_types=[lhs.type])

T: ClassVar = VarConstraint('T', base(BitVectorType)) class-attribute instance-attribute

lhs = operand_def(T) class-attribute instance-attribute

rhs = operand_def(T) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

assembly_format = '$lhs `,` $rhs attr-dict `:` type($result)' class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(lhs: SSAValue[BitVectorType], rhs: SSAValue[BitVectorType])

Source code in xdsl/dialects/smt.py
702
703
def __init__(self, lhs: SSAValue[BitVectorType], rhs: SSAValue[BitVectorType]):
    super().__init__(operands=[lhs, rhs], result_types=[lhs.type])

BVAndOp dataclass

Bases: BinaryBVOp

A bitwise AND operation for bitvectors. It corresponds to the 'bvand' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
706
707
708
709
710
711
712
713
@irdl_op_definition
class BVAndOp(BinaryBVOp):
    """
    A bitwise AND operation for bitvectors.
    It corresponds to the 'bvand' operation in SMT-LIB.
    """

    name = "smt.bv.and"

name = 'smt.bv.and' class-attribute instance-attribute

BVOrOp dataclass

Bases: BinaryBVOp

A bitwise OR operation for bitvectors. It corresponds to the 'bvor' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
716
717
718
719
720
721
722
723
@irdl_op_definition
class BVOrOp(BinaryBVOp):
    """
    A bitwise OR operation for bitvectors.
    It corresponds to the 'bvor' operation in SMT-LIB.
    """

    name = "smt.bv.or"

name = 'smt.bv.or' class-attribute instance-attribute

BVXOrOp dataclass

Bases: BinaryBVOp

A bitwise XOR operation for bitvectors. It corresponds to the 'bvxor' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
726
727
728
729
730
731
732
733
@irdl_op_definition
class BVXOrOp(BinaryBVOp):
    """
    A bitwise XOR operation for bitvectors.
    It corresponds to the 'bvxor' operation in SMT-LIB.
    """

    name = "smt.bv.xor"

name = 'smt.bv.xor' class-attribute instance-attribute

BVAddOp dataclass

Bases: BinaryBVOp

An addition operation for bitvectors. It corresponds to the 'bvadd' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
736
737
738
739
740
741
742
743
@irdl_op_definition
class BVAddOp(BinaryBVOp):
    """
    An addition operation for bitvectors.
    It corresponds to the 'bvadd' operation in SMT-LIB.
    """

    name = "smt.bv.add"

name = 'smt.bv.add' class-attribute instance-attribute

BVMulOp dataclass

Bases: BinaryBVOp

A multiplication operation for bitvectors. It corresponds to the 'bvmul' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
746
747
748
749
750
751
752
753
@irdl_op_definition
class BVMulOp(BinaryBVOp):
    """
    A multiplication operation for bitvectors.
    It corresponds to the 'bvmul' operation in SMT-LIB.
    """

    name = "smt.bv.mul"

name = 'smt.bv.mul' class-attribute instance-attribute

BVUDivOp dataclass

Bases: BinaryBVOp

An unsigned division operation (rounded towards zero) for bitvectors. It corresponds to the 'bvudiv' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
756
757
758
759
760
761
762
763
@irdl_op_definition
class BVUDivOp(BinaryBVOp):
    """
    An unsigned division operation (rounded towards zero) for bitvectors.
    It corresponds to the 'bvudiv' operation in SMT-LIB.
    """

    name = "smt.bv.udiv"

name = 'smt.bv.udiv' class-attribute instance-attribute

BVSDivOp dataclass

Bases: BinaryBVOp

A two's complement signed division operation (rounded towards zero) for bitvectors. It corresponds to the 'bvsdiv' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
766
767
768
769
770
771
772
773
@irdl_op_definition
class BVSDivOp(BinaryBVOp):
    """
    A two's complement signed division operation (rounded towards zero) for bitvectors.
    It corresponds to the 'bvsdiv' operation in SMT-LIB.
    """

    name = "smt.bv.sdiv"

name = 'smt.bv.sdiv' class-attribute instance-attribute

BVURemOp dataclass

Bases: BinaryBVOp

An unsigned remainder for bitvectors. It corresponds to the 'bvurem' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
776
777
778
779
780
781
782
783
@irdl_op_definition
class BVURemOp(BinaryBVOp):
    """
    An unsigned remainder for bitvectors.
    It corresponds to the 'bvurem' operation in SMT-LIB.
    """

    name = "smt.bv.urem"

name = 'smt.bv.urem' class-attribute instance-attribute

BVSRemOp dataclass

Bases: BinaryBVOp

A two's complement signed remainder (sign follows dividend) for bitvectors. It corresponds to the 'bvsrem' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
786
787
788
789
790
791
792
793
@irdl_op_definition
class BVSRemOp(BinaryBVOp):
    """
    A two's complement signed remainder (sign follows dividend) for bitvectors.
    It corresponds to the 'bvsrem' operation in SMT-LIB.
    """

    name = "smt.bv.srem"

name = 'smt.bv.srem' class-attribute instance-attribute

BVSModOp dataclass

Bases: BinaryBVOp

A two's complement signed remainder (sign follows divisor) for bitvectors. It corresponds to the 'bvsmod' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
796
797
798
799
800
801
802
803
@irdl_op_definition
class BVSModOp(BinaryBVOp):
    """
    A two's complement signed remainder (sign follows divisor) for bitvectors.
    It corresponds to the 'bvsmod' operation in SMT-LIB.
    """

    name = "smt.bv.smod"

name = 'smt.bv.smod' class-attribute instance-attribute

BVShlOp dataclass

Bases: BinaryBVOp

A shift left for bitvectors. It corresponds to the 'bvshl' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
806
807
808
809
810
811
812
813
@irdl_op_definition
class BVShlOp(BinaryBVOp):
    """
    A shift left for bitvectors.
    It corresponds to the 'bvshl' operation in SMT-LIB.
    """

    name = "smt.bv.shl"

name = 'smt.bv.shl' class-attribute instance-attribute

BVLShrOp dataclass

Bases: BinaryBVOp

A logical shift right for bitvectors. It corresponds to the 'bvlshr' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
816
817
818
819
820
821
822
823
@irdl_op_definition
class BVLShrOp(BinaryBVOp):
    """
    A logical shift right for bitvectors.
    It corresponds to the 'bvlshr' operation in SMT-LIB.
    """

    name = "smt.bv.lshr"

name = 'smt.bv.lshr' class-attribute instance-attribute

BVAShrOp dataclass

Bases: BinaryBVOp

An arithmetic shift right for bitvectors. It corresponds to the 'bvashr' operation in SMT-LIB.

Source code in xdsl/dialects/smt.py
826
827
828
829
830
831
832
833
@irdl_op_definition
class BVAShrOp(BinaryBVOp):
    """
    An arithmetic shift right for bitvectors.
    It corresponds to the 'bvashr' operation in SMT-LIB.
    """

    name = "smt.bv.ashr"

name = 'smt.bv.ashr' class-attribute instance-attribute