LLZK
2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Interpreter.h
Go to the documentation of this file.
1
//===-- Interpreter.h - llzk-witgen compute interpreter ---------*- C++ -*-===//
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
#pragma once
11
12
#include "
ValueModel.h
"
13
14
#include "
llzk/Dialect/Function/IR/Ops.h
"
15
16
#include <mlir/IR/BuiltinOps.h>
17
18
#include <llvm/ADT/SmallVector.h>
19
20
#include <random>
21
22
namespace
llzk::witgen
{
23
25
class
FunctionInterpreter
{
26
public
:
28
FunctionInterpreter
(
29
mlir::ModuleOp moduleOp, mlir::SymbolTableCollection &tables,
const
llzk::Field
&field,
30
UninitializedBehavior
uninitializedBehavior, std::mt19937_64 rng
31
);
32
34
llvm::Expected<llvm::SmallVector<WitnessVal>>
35
run
(
llzk::function::FuncDefOp
funcOp, mlir::ArrayRef<WitnessVal> args);
36
37
private
:
38
mlir::ModuleOp moduleOp;
39
mlir::SymbolTableCollection &tables;
40
const
llzk::Field
&field;
41
UninitializedBehavior
uninitializedBehavior =
UninitializedBehavior::Zero
;
42
std::mt19937_64 rng;
43
};
44
45
}
// namespace llzk::witgen
Ops.h
ValueModel.h
llzk::Field
Information about the prime finite field used for the interval analysis.
Definition
Field.h:36
llzk::function::FuncDefOp
Definition
Ops.h.inc:620
llzk::witgen::FunctionInterpreter::run
llvm::Expected< llvm::SmallVector< WitnessVal > > run(llzk::function::FuncDefOp funcOp, mlir::ArrayRef< WitnessVal > args)
Run a function with concrete arguments and return its result values.
Definition
Interpreter.cpp:1173
llzk::witgen::FunctionInterpreter::FunctionInterpreter
FunctionInterpreter(mlir::ModuleOp moduleOp, mlir::SymbolTableCollection &tables, const llzk::Field &field, UninitializedBehavior uninitializedBehavior, std::mt19937_64 rng)
Build an interpreter for one module and field configuration.
Definition
Interpreter.cpp:77
llzk::witgen
Definition
Errors.h:15
llzk::witgen::UninitializedBehavior
UninitializedBehavior
Control how witgen materializes uninitialized/default values.
Definition
ValueModel.h:55
llzk::witgen::UninitializedBehavior::Zero
@ Zero
Definition
ValueModel.h:56
tools
llzk-witgen
Interpreter.h
Generated by
1.14.0
Copyright 2025 Veridise Inc. under the Apache License v2.0. Copyright 2026 Project LLZK under the Apache License v2.0.