LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Bool.cpp
Go to the documentation of this file.
1//===-- Bool.cpp - Bool dialect C API implementation ------------*- C++ -*-===//
2//
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
7//
8//===----------------------------------------------------------------------===//
9
10#include "llzk-c/Dialect/Bool.h"
11
12#include "llzk/CAPI/Support.h"
19
20#include <mlir/CAPI/Pass.h>
21#include <mlir/CAPI/Registration.h>
22
23using namespace llzk::boolean;
24
25static inline void registerLLZKBoolTransformationPasses() { registerTransformationPasses(); }
26
27// Include the generated CAPI
29// Enums must come before Attrs and Ops
33
34MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Bool, llzk__boolean, BoolDialect)
35
37 auto cppType = unwrap(type);
38 if (!mlir::isa<llzk::array::ArrayType>(cppType)) {
39 return wrap(Type());
40 }
41
42 return wrap(
43 llzk::boolean::getQuantifierOpDomainIterType(mlir::cast<llzk::array::ArrayType>(cppType))
44 );
45}
MlirType llzkBool_QuantifierOpGetDomainIterType(MlirType type)
Returns the type used in a quantifier operation's block argument.
Definition Bool.cpp:36
mlir::Type getQuantifierOpDomainIterType(llzk::array::ArrayType arr)
Extracts the type used for a quantifier op block argument.
Definition Utils.h:20
void registerTransformationPasses()