LLZK 0.1.0
Veridise's ZK Language IR
|
Defines a reference to a llzk object within a constrain function call. More...
#include <ConstrainRef.h>
Classes | |
struct | Hash |
Public Member Functions | |
ConstrainRef (mlir::BlockArgument b) | |
ConstrainRef (mlir::BlockArgument b, std::vector< ConstrainRefIndex > f) | |
ConstrainRef (component::CreateStructOp createOp) | |
ConstrainRef (component::CreateStructOp createOp, std::vector< ConstrainRefIndex > f) | |
ConstrainRef (felt::FeltConstantOp c) | |
ConstrainRef (mlir::arith::ConstantIndexOp c) | |
ConstrainRef (polymorphic::ConstReadOp c) | |
mlir::Type | getType () const |
bool | isConstantFelt () const |
bool | isConstantIndex () const |
bool | isTemplateConstant () const |
bool | isConstant () const |
bool | isConstantInt () const |
bool | isFeltVal () const |
bool | isIndexVal () const |
bool | isIntegerVal () const |
bool | isTypeVarVal () const |
bool | isScalar () const |
bool | isSignal () const |
bool | isBlockArgument () const |
mlir::BlockArgument | getBlockArgument () const |
unsigned | getInputNum () const |
bool | isCreateStructOp () const |
component::CreateStructOp | getCreateStructOp () const |
mlir::APInt | getConstantFeltValue () const |
mlir::APInt | getConstantIndexValue () const |
mlir::APInt | getConstantValue () const |
bool | isValidPrefix (const ConstrainRef &prefix) const |
Returns true iff prefix is a valid prefix of this reference. | |
mlir::FailureOr< std::vector< ConstrainRefIndex > > | getSuffix (const ConstrainRef &prefix) const |
If prefix is a valid prefix of this reference, return the suffix that remains after removing the prefix. | |
mlir::FailureOr< ConstrainRef > | translate (const ConstrainRef &prefix, const ConstrainRef &other) const |
Create a new reference with prefix replaced with other iff prefix is a valid prefix for this reference. | |
mlir::FailureOr< ConstrainRef > | getParentPrefix () const |
Create a new reference that is the immediate prefix of this reference if possible. | |
std::vector< ConstrainRef > | getAllChildren (mlir::SymbolTableCollection &tables, mlir::ModuleOp mod) const |
Get all direct children of this ConstrainRef, assuming this ref is not a scalar. | |
ConstrainRef | createChild (ConstrainRefIndex r) const |
ConstrainRef | createChild (ConstrainRef other) const |
const std::vector< ConstrainRefIndex > & | getPieces () const |
void | print (mlir::raw_ostream &os) const |
void | dump () const |
bool | operator== (const ConstrainRef &rhs) const |
bool | operator!= (const ConstrainRef &rhs) const |
bool | operator< (const ConstrainRef &rhs) const |
bool | operator> (const ConstrainRef &rhs) const |
Static Public Member Functions | |
static std::vector< ConstrainRef > | getAllConstrainRefs (mlir::SymbolTableCollection &tables, mlir::ModuleOp mod, ConstrainRef root) |
Produce all possible ConstraintRefs that are present starting from the given root. | |
static std::vector< ConstrainRef > | getAllConstrainRefs (component::StructDefOp structDef, function::FuncDefOp fnOp) |
Produce all possible ConstrainRefs that are present from given struct function. | |
static std::vector< ConstrainRef > | getAllConstrainRefs (component::StructDefOp structDef, component::FieldDefOp fieldDef) |
Produce all possible ConstrainRefs from a specific field in a struct. | |
Defines a reference to a llzk object within a constrain function call.
The object may be a reference to an individual felt, felt.const, or a composite type, like an array or an entire struct.
Definition at line 121 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 137 of file ConstrainRef.h.
|
inline |
Definition at line 138 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 141 of file ConstrainRef.h.
|
inline |
Definition at line 143 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 146 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 147 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 149 of file ConstrainRef.h.
|
inline |
Definition at line 248 of file ConstrainRef.h.
|
inline |
Definition at line 242 of file ConstrainRef.h.
|
inline |
Definition at line 256 of file ConstrainRef.h.
std::vector< ConstrainRef > llzk::ConstrainRef::getAllChildren | ( | mlir::SymbolTableCollection & | tables, |
mlir::ModuleOp | mod ) const |
Get all direct children of this ConstrainRef, assuming this ref is not a scalar.
Definition at line 282 of file ConstrainRef.cpp.
|
static |
Produce all possible ConstrainRefs from a specific field in a struct.
May produce multiple if the given field is of an aggregate type.
Definition at line 151 of file ConstrainRef.cpp.
|
static |
Produce all possible ConstrainRefs that are present from given struct function.
Definition at line 121 of file ConstrainRef.cpp.
|
static |
Produce all possible ConstraintRefs that are present starting from the given root.
|
inline |
Definition at line 180 of file ConstrainRef.h.
|
inline |
Definition at line 194 of file ConstrainRef.h.
|
inline |
Definition at line 198 of file ConstrainRef.h.
|
inline |
Definition at line 202 of file ConstrainRef.h.
|
inline |
Definition at line 189 of file ConstrainRef.h.
|
inline |
Definition at line 184 of file ConstrainRef.h.
|
inline |
Create a new reference that is the immediate prefix of this reference if possible.
Definition at line 229 of file ConstrainRef.h.
|
inline |
Definition at line 253 of file ConstrainRef.h.
FailureOr< std::vector< ConstrainRefIndex > > llzk::ConstrainRef::getSuffix | ( | const ConstrainRef & | prefix | ) | const |
If prefix
is a valid prefix of this reference, return the suffix that remains after removing the prefix.
I.e., this
= prefix
+ suffix
prefix |
Definition at line 216 of file ConstrainRef.cpp.
Type llzk::ConstrainRef::getType | ( | ) | const |
Definition at line 170 of file ConstrainRef.cpp.
|
inline |
Definition at line 177 of file ConstrainRef.h.
|
inline |
Definition at line 165 of file ConstrainRef.h.
|
inline |
Definition at line 154 of file ConstrainRef.h.
|
inline |
Definition at line 157 of file ConstrainRef.h.
|
inline |
Definition at line 166 of file ConstrainRef.h.
|
inline |
Definition at line 186 of file ConstrainRef.h.
|
inline |
Definition at line 168 of file ConstrainRef.h.
|
inline |
Definition at line 169 of file ConstrainRef.h.
|
inline |
Definition at line 170 of file ConstrainRef.h.
|
inline |
Definition at line 172 of file ConstrainRef.h.
|
inline |
Definition at line 175 of file ConstrainRef.h.
|
inline |
Definition at line 161 of file ConstrainRef.h.
|
inline |
Definition at line 171 of file ConstrainRef.h.
bool llzk::ConstrainRef::isValidPrefix | ( | const ConstrainRef & | prefix | ) | const |
Returns true iff prefix
is a valid prefix of this reference.
Definition at line 200 of file ConstrainRef.cpp.
|
inline |
Definition at line 260 of file ConstrainRef.h.
bool llzk::ConstrainRef::operator< | ( | const ConstrainRef & | rhs | ) | const |
Definition at line 327 of file ConstrainRef.cpp.
bool llzk::ConstrainRef::operator== | ( | const ConstrainRef & | rhs | ) | const |
Definition at line 317 of file ConstrainRef.cpp.
|
inline |
Definition at line 265 of file ConstrainRef.h.
void llzk::ConstrainRef::print | ( | mlir::raw_ostream & | os | ) | const |
Definition at line 293 of file ConstrainRef.cpp.
FailureOr< ConstrainRef > llzk::ConstrainRef::translate | ( | const ConstrainRef & | prefix, |
const ConstrainRef & | other ) const |
Create a new reference with prefix replaced with other iff prefix is a valid prefix for this reference.
If this reference is a felt.const, the translation will always succeed and return the felt.const unchanged.
prefix | |
other |
Definition at line 229 of file ConstrainRef.cpp.