1//===-- OpInterfaces.td ------------------------------------*- tablegen -*-===//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2026 Project LLZK
6// SPDX-License-Identifier: Apache-2.0
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_VERIF_OP_INTERFACES
11#define LLZK_VERIF_OP_INTERFACES
13include "mlir/IR/Interfaces.td"
14include "mlir/Interfaces/SideEffectInterfaces.td"
15include "mlir/Interfaces/MemorySlotInterfaces.td"
17def ConditionOpInterface
18 : OpInterface<"ConditionOpInterface", [DeclareOpInterfaceMethods<
19 MemoryEffectsOpInterface>]> {
21 Common interface for precondition and postcondition operations.
23 This declares the `MemoryEffectsOpInterface`, which, like the `cf.assert` (MLIR `cf` dialect)
24 and `bool.assert` (LLZK `bool` dialect) ops, adds a MemWrite affect to model program termination.
26 let cppNamespace = "::llzk::verif";
29 // Requires implementors to have a condition argument
30 InterfaceMethod<[{Gets the SSA Value for the condition operand.}],
31 "::mlir::TypedValue<::mlir::IntegerType>", "getCondition",
35def PreconditionOpInterface
36 : OpInterface<"PreconditionOpInterface", [ConditionOpInterface]> {
38 Common interface for precondition operations (i.e., `require_*`).
40 let cppNamespace = "::llzk::verif";
43def PostconditionOpInterface
44 : OpInterface<"PostconditionOpInterface", [ConditionOpInterface]> {
46 Common interface for postcondition operations (i.e., `ensure_*`).
48 let cppNamespace = "::llzk::verif";
51#endif // LLZK_VERIF_OP_INTERFACES