1//===-- OpTraits.td ----------------------------------------*- tablegen -*-===//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_FUNCTION_TRAITS
11#define LLZK_FUNCTION_TRAITS
13include "mlir/IR/OpBase.td"
15/// Marker for ops that are specific to witness generation. Op classes with
16/// this trait are valid only in functions that have the `AllowWitnessAttr`.
17def WitnessGen : NativeOpTrait<"WitnessGen">, StructuralOpTrait {
18 string cppNamespace = "::llzk::function";
21/// Marker for ops that are specific to constraint generation. Op classes with
22/// this trait are valid only in functions that have the `AllowConstraintAttr`.
23def ConstraintGen : NativeOpTrait<"ConstraintGen">, StructuralOpTrait {
24 string cppNamespace = "::llzk::function";
27/// Marker for ops over `llzk.felt` type operands that are not native to finite
28/// field arithmetic and thus must be rewritten or folded into a constant after
29/// the flattening and unrolling pass. Op classes with this trait are valid only
30/// in functions that have the `AllowNonNativeFieldOpsAttr`.
31def NotFieldNative : NativeOpTrait<"NotFieldNative">, StructuralOpTrait {
32 string cppNamespace = "::llzk::function";
35#endif // LLZK_FUNCTION_TRAITS