LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
ValueModel.h File Reference
#include "llzk/Dialect/Array/IR/Types.h"
#include "llzk/Dialect/POD/IR/Types.h"
#include "llzk/Dialect/Struct/IR/Ops.h"
#include "llzk/Dialect/Struct/IR/Types.h"
#include "llzk/Util/Field.h"
#include <llvm/ADT/DenseMap.h>
#include <llvm/ADT/DynamicAPInt.h>
#include <llvm/ADT/StringRef.h>
#include <llvm/Support/Error.h>
#include <cstdint>
#include <memory>
#include <optional>
#include <random>
#include <variant>
#include <vector>
Include dependency graph for ValueModel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llzk::witgen::ArrayValue
 Materialized array value with flattened element storage. More...
struct  llzk::witgen::PodValue
 Materialized POD value keyed by record name. More...
struct  llzk::witgen::StructValue
 Materialized struct value keyed by member name. More...

Namespaces

namespace  mlir
namespace  llzk
namespace  llzk::witgen

Typedefs

using llzk::witgen::ArrayValueRef = std::shared_ptr<ArrayValue>
 Shared runtime storage for LLZK array values.
using llzk::witgen::PodValueRef = std::shared_ptr<PodValue>
 Shared runtime storage for LLZK POD values.
using llzk::witgen::StructValueRef = std::shared_ptr<StructValue>
 Shared runtime storage for LLZK struct values.
using llzk::witgen::WitnessVal
 Runtime value representation used by the tool-local interpreter.

Enumerations

enum class  llzk::witgen::UninitializedBehavior : std::uint8_t { llzk::witgen::Zero , llzk::witgen::Random , llzk::witgen::Fail }
 Control how witgen materializes uninitialized/default values. More...

Functions

llvm::Expected< bool > llzk::witgen::asBool (const WitnessVal &value)
 Require a boolean value from the runtime variant.
llvm::Expected< int64_t > llzk::witgen::asIndex (const WitnessVal &value)
 Require an index value from the runtime variant.
llvm::Expected< llvm::DynamicAPInt > llzk::witgen::asFelt (const WitnessVal &value)
 Require a felt value from the runtime variant.
llvm::Expected< ArrayValueRefllzk::witgen::asArray (const WitnessVal &value)
 Require an array value from the runtime variant.
llvm::Expected< PodValueRefllzk::witgen::asPod (const WitnessVal &value)
 Require a POD value from the runtime variant.
llvm::Expected< StructValueRefllzk::witgen::asStruct (const WitnessVal &value)
 Require a struct value from the runtime variant.
llvm::Expected< WitnessValllzk::witgen::defaultValue (mlir::Type type, mlir::SymbolTableCollection &tables, mlir::Operation *origin, const llzk::Field &field, UninitializedBehavior behavior, std::mt19937_64 *rng=nullptr)
 Build a default value used for llzk.nondet and aggregate constructors.