LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::LLZKLayout Struct Reference

Logical felt-signal paths in a monomorphized LLZK circuit. More...

#include <LLZKLayout.h>

Public Member Functions

std::optional< uint64_t > getSignalId (mlir::ArrayAttr path) const
 Look up a structural path in this layout.

Public Attributes

llvm::SmallVector< mlir::ArrayAttr > signalPaths
 Structural paths indexed by logical signal ID.
llvm::DenseMap< mlir::ArrayAttr, uint64_t > signalIds
 Reverse mapping from structural storage paths to logical signal IDs.
llvm::SmallVector< mlir::StringAttr > argumentNames
 Optional display names indexed by constrain argument position.

Detailed Description

Logical felt-signal paths in a monomorphized LLZK circuit.

The first path segment is "main" for the main instance, or "arg" followed by an i64 constrain argument position. Subsequent segments are StringAttr member names or index attributes for array indices. Signal IDs are positions in signalPaths, starting at zero. Struct members and POD fields are visited in declaration order, expanding each field fully before the next. Arrays use numeric index order. Constrain arguments come first in signature order, followed by the main instance's members. Every declared signal receives an ID, including unused signals. Members must have the signal annotation, except main's public members, which are implicit signals. Main's inputs are also implicit signals. These IDs are independent of any backend's wire numbering or auxiliary variables.

Definition at line 45 of file LLZKLayout.h.

Member Function Documentation

◆ getSignalId()

std::optional< uint64_t > llzk::LLZKLayout::getSignalId ( mlir::ArrayAttr path) const

Look up a structural path in this layout.

Argument names are display labels; the argument position in the path determines argument identity.

Definition at line 304 of file LLZKLayout.cpp.

Member Data Documentation

◆ argumentNames

llvm::SmallVector<mlir::StringAttr> llzk::LLZKLayout::argumentNames

Optional display names indexed by constrain argument position.

Entry zero represents self and is always null; unnamed arguments also have null entries.

Definition at line 52 of file LLZKLayout.h.

◆ signalIds

llvm::DenseMap<mlir::ArrayAttr, uint64_t> llzk::LLZKLayout::signalIds

Reverse mapping from structural storage paths to logical signal IDs.

Definition at line 49 of file LLZKLayout.h.

◆ signalPaths

llvm::SmallVector<mlir::ArrayAttr> llzk::LLZKLayout::signalPaths

Structural paths indexed by logical signal ID.

Definition at line 47 of file LLZKLayout.h.


The documentation for this struct was generated from the following files: