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 (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 | 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 |
mlir::APInt | getConstantFeltValue () const |
mlir::APInt | getConstantIndexValue () const |
mlir::APInt | getConstantInt () 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. | |
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 (component::StructDefOp structDef) |
Produce all possible ConstraintRefs that are present from the struct's constrain function. | |
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 111 of file ConstrainRef.h.
|
inlineexplicit |
Definition at line 142 of file ConstrainRef.h.
|
inline |
Definition at line 144 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 234 of file ConstrainRef.h.
|
inline |
Definition at line 228 of file ConstrainRef.h.
|
inline |
Definition at line 244 of file ConstrainRef.h.
|
static |
Produce all possible ConstraintRefs that are present from the struct's constrain function.
Definition at line 183 of file ConstrainRef.cpp.
|
inline |
Definition at line 177 of file ConstrainRef.h.
|
inline |
Definition at line 183 of file ConstrainRef.h.
|
inline |
Definition at line 187 of file ConstrainRef.h.
|
inline |
Definition at line 191 of file ConstrainRef.h.
|
inline |
Definition at line 181 of file ConstrainRef.h.
|
inline |
Create a new reference that is the immediate prefix of this reference if possible.
Definition at line 219 of file ConstrainRef.h.
|
inline |
Definition at line 241 of file ConstrainRef.h.
mlir::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 249 of file ConstrainRef.cpp.
mlir::Type llzk::ConstrainRef::getType | ( | ) | const |
Definition at line 205 of file ConstrainRef.cpp.
|
inline |
Definition at line 176 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 167 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 171 of file ConstrainRef.h.
|
inline |
Definition at line 174 of file ConstrainRef.h.
|
inline |
Definition at line 161 of file ConstrainRef.h.
|
inline |
Definition at line 170 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 233 of file ConstrainRef.cpp.
|
inline |
Definition at line 248 of file ConstrainRef.h.
bool llzk::ConstrainRef::operator< | ( | const ConstrainRef & | rhs | ) | const |
Definition at line 301 of file ConstrainRef.cpp.
bool llzk::ConstrainRef::operator== | ( | const ConstrainRef & | rhs | ) | const |
Definition at line 295 of file ConstrainRef.cpp.
|
inline |
Definition at line 253 of file ConstrainRef.h.
void llzk::ConstrainRef::print | ( | mlir::raw_ostream & | os | ) | const |
Definition at line 276 of file ConstrainRef.cpp.
mlir::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 262 of file ConstrainRef.cpp.