1//===-- Ops.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//===----------------------------------------------------------------------===//
13include "llzk/Dialect/LLZK/IR/Dialect.td"
14include "llzk/Dialect/Shared/Types.td"
16include "mlir/IR/OpAsmInterface.td"
17include "mlir/IR/OpBase.td"
18include "mlir/Interfaces/SideEffectInterfaces.td"
20//===------------------------------------------------------------------===//
22//===------------------------------------------------------------------===//
24class LLZKDialectOp<string mnemonic, list<Trait> traits = []>
25 : Op<LLZKDialect, mnemonic, traits>;
28 : LLZKDialectOp<"nondet", [ConstantLike, Pure,
29 DeclareOpInterfaceMethods<
30 OpAsmOpInterface, ["getAsmResultNames"]>]> {
31 let summary = "uninitialized variable";
33 This operation produces an SSA variable of the specified type but with
34 nondeterministic value.
36 This op can be used in `@constrain()` functions in place of expressions that
37 cannot be included in constraints. It may also be generated for a frontend
38 language that supports uninitialized variables and can also be introduced by
39 the `llzk-array-to-scalar` pass if there is a read from an array index
40 that was not dominated by an earlier write to that same index.
45 %0 = llzk.nondet : !felt.type
49 let results = (outs AnyLLZKType:$res);
50 let assemblyFormat = [{ `:` type($res) attr-dict }];