LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::polymorphic::detail::ConstraintBindings Class Reference

Bind scalar leaves without constructing a shadow array or POD object. More...

#include <ConstraintBindings.h>

Public Types

using StorageReader

Public Member Functions

 ConstraintBindings (mlir::MLIRContext *context)
AccessPath create (mlir::Type type, mlir::Value input={}, mlir::Value storage={})
 Create a root for a local allocation, function argument, or original storage.
AccessPath child (AccessPath parent, mlir::Attribute step, mlir::Type type)
 Extend an already-validated path with one record or coordinate.
AccessPath element (AccessPath parent, int64_t index)
 Select one dimension; callers check that the coordinate is static/in-bounds.
mlir::FailureOr< AccessPath > select (AccessPath path, mlir::Attribute step, mlir::Operation *site)
 Resolve one concrete step, including those transferred into a destination.
mlir::LogicalResult elements (AccessPath path, mlir::Operation *site, llvm::function_ref< mlir::LogicalResult(AccessPath)> visit)
 Visit array elements in row-major order, preserving aggregate element types.
mlir::LogicalResult walk (AccessPath path, mlir::Operation *site, llvm::function_ref< mlir::LogicalResult(AccessPath)> visit)
 Enumerate scalar leaves using types, without allocating aggregate objects.
mlir::FailureOr< mlir::Value > load (AccessPath path, mlir::Operation *site, StorageReader read)
 Resolve a scalar binding; original storage is read only when needed.
void protect (AccessPath path)
 Temporarily make an argument root read-only without copying its identity.
void unprotect (AccessPath path)
 Release one call's protection; enclosing calls retain their own protection.
mlir::LogicalResult writable (AccessPath path, mlir::Operation *site) const
 Reject writes based on destination identity, never scalar provenance.
void store (AccessPath path, mlir::Value value)
 Bind a scalar leaf during initialization or after checking writability.
mlir::LogicalResult transfer (AccessPath destination, AccessPath source, mlir::Operation *site, StorageReader read)
 Snapshot leaves before replacing a subtree, including overlapping copies.

Detailed Description

Bind scalar leaves without constructing a shadow array or POD object.

Function inputs and original storage are immutable roots. Local roots contain independent bindings, including when their scalar values originated in inputs.

Definition at line 41 of file ConstraintBindings.h.

Member Typedef Documentation

◆ StorageReader

Initial value:
llvm::function_ref<mlir::FailureOr<mlir::Value>(
mlir::Value, llvm::ArrayRef<mlir::Attribute>, mlir::Type, mlir::Operation *
)>

Definition at line 53 of file ConstraintBindings.h.

Constructor & Destructor Documentation

◆ ConstraintBindings()

llzk::polymorphic::detail::ConstraintBindings::ConstraintBindings ( mlir::MLIRContext * context)
inlineexplicit

Definition at line 57 of file ConstraintBindings.h.

Member Function Documentation

◆ child()

AccessPath llzk::polymorphic::detail::ConstraintBindings::child ( AccessPath parent,
mlir::Attribute step,
mlir::Type type )
inline

Extend an already-validated path with one record or coordinate.

Definition at line 69 of file ConstraintBindings.h.

◆ create()

AccessPath llzk::polymorphic::detail::ConstraintBindings::create ( mlir::Type type,
mlir::Value input = {},
mlir::Value storage = {} )
inline

Create a root for a local allocation, function argument, or original storage.

Definition at line 60 of file ConstraintBindings.h.

◆ element()

AccessPath llzk::polymorphic::detail::ConstraintBindings::element ( AccessPath parent,
int64_t index )
inline

Select one dimension; callers check that the coordinate is static/in-bounds.

Definition at line 76 of file ConstraintBindings.h.

◆ elements()

mlir::LogicalResult llzk::polymorphic::detail::ConstraintBindings::elements ( AccessPath path,
mlir::Operation * site,
llvm::function_ref< mlir::LogicalResult(AccessPath)> visit )
inline

Visit array elements in row-major order, preserving aggregate element types.

Definition at line 112 of file ConstraintBindings.h.

◆ load()

mlir::FailureOr< mlir::Value > llzk::polymorphic::detail::ConstraintBindings::load ( AccessPath path,
mlir::Operation * site,
StorageReader read )
inline

Resolve a scalar binding; original storage is read only when needed.

Definition at line 158 of file ConstraintBindings.h.

◆ protect()

void llzk::polymorphic::detail::ConstraintBindings::protect ( AccessPath path)
inline

Temporarily make an argument root read-only without copying its identity.

Definition at line 179 of file ConstraintBindings.h.

◆ select()

mlir::FailureOr< AccessPath > llzk::polymorphic::detail::ConstraintBindings::select ( AccessPath path,
mlir::Attribute step,
mlir::Operation * site )
inline

Resolve one concrete step, including those transferred into a destination.

Definition at line 85 of file ConstraintBindings.h.

◆ store()

void llzk::polymorphic::detail::ConstraintBindings::store ( AccessPath path,
mlir::Value value )
inline

Bind a scalar leaf during initialization or after checking writability.

Definition at line 194 of file ConstraintBindings.h.

◆ transfer()

mlir::LogicalResult llzk::polymorphic::detail::ConstraintBindings::transfer ( AccessPath destination,
AccessPath source,
mlir::Operation * site,
StorageReader read )
inline

Snapshot leaves before replacing a subtree, including overlapping copies.

Missing local leaves stay uninitialized; copying does not read them.

Definition at line 199 of file ConstraintBindings.h.

◆ unprotect()

void llzk::polymorphic::detail::ConstraintBindings::unprotect ( AccessPath path)
inline

Release one call's protection; enclosing calls retain their own protection.

Definition at line 182 of file ConstraintBindings.h.

◆ walk()

mlir::LogicalResult llzk::polymorphic::detail::ConstraintBindings::walk ( AccessPath path,
mlir::Operation * site,
llvm::function_ref< mlir::LogicalResult(AccessPath)> visit )
inline

Enumerate scalar leaves using types, without allocating aggregate objects.

Definition at line 133 of file ConstraintBindings.h.

◆ writable()

mlir::LogicalResult llzk::polymorphic::detail::ConstraintBindings::writable ( AccessPath path,
mlir::Operation * site ) const
inline

Reject writes based on destination identity, never scalar provenance.

Definition at line 185 of file ConstraintBindings.h.


The documentation for this class was generated from the following file: