LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
OpInterfaces.td
Go to the documentation of this file.
1//===-- OpInterfaces.td ------------------------------------*- tablegen -*-===//
2//
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
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLZK_VERIF_OP_INTERFACES
11#define LLZK_VERIF_OP_INTERFACES
12
13include "mlir/IR/Interfaces.td"
14include "mlir/Interfaces/SideEffectInterfaces.td"
15include "mlir/Interfaces/MemorySlotInterfaces.td"
16
17def ConditionOpInterface
18 : OpInterface<"ConditionOpInterface", [DeclareOpInterfaceMethods<
19 MemoryEffectsOpInterface>]> {
20 let description = [{
21 Common interface for precondition and postcondition operations.
22
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.
25 }];
26 let cppNamespace = "::llzk::verif";
27
28 let methods = [
29 // Requires implementors to have a condition argument
30 InterfaceMethod<[{Gets the SSA Value for the condition operand.}],
31 "::mlir::TypedValue<::mlir::IntegerType>", "getCondition",
32 (ins)>];
33}
34
35def PreconditionOpInterface
36 : OpInterface<"PreconditionOpInterface", [ConditionOpInterface]> {
37 let description = [{
38 Common interface for precondition operations (i.e., `require_*`).
39 }];
40 let cppNamespace = "::llzk::verif";
41}
42
43def PostconditionOpInterface
44 : OpInterface<"PostconditionOpInterface", [ConditionOpInterface]> {
45 let description = [{
46 Common interface for postcondition operations (i.e., `ensure_*`).
47 }];
48 let cppNamespace = "::llzk::verif";
49}
50
51#endif // LLZK_VERIF_OP_INTERFACES