LLZK 0.1.0
Veridise's ZK Language IR
|
Tracks a solver expression and an interval range for that expression. More...
#include <IntervalAnalysis.h>
Classes | |
struct | Hash |
Public Member Functions | |
ExpressionValue () | |
ExpressionValue (const Field &f, llvm::SMTExprRef exprRef) | |
ExpressionValue (const Field &f, llvm::SMTExprRef exprRef, llvm::APSInt singleVal) | |
ExpressionValue (llvm::SMTExprRef exprRef, Interval interval) | |
llvm::SMTExprRef | getExpr () const |
const Interval & | getInterval () const |
const Field & | getField () const |
ExpressionValue | withInterval (const Interval &newInterval) const |
Return the current expression with a new interval. | |
ExpressionValue & | join (const ExpressionValue &rhs) |
Fold two expressions together when overapproximating array elements. | |
bool | operator== (const ExpressionValue &rhs) const |
void | print (mlir::raw_ostream &os) const |
Friends | |
ExpressionValue | intersection (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
Compute the intersection of the lhs and rhs intervals, and create a solver expression that constrains both sides to be equal. | |
ExpressionValue | join (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
Compute the union of the lhs and rhs intervals, and create a solver expression that constrains both sides to be equal. | |
ExpressionValue | add (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | sub (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | mul (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | div (llvm::SMTSolverRef solver, felt::DivFeltOp op, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | mod (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | bitAnd (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | shiftLeft (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | shiftRight (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | cmp (llvm::SMTSolverRef solver, boolean::CmpOp op, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | boolAnd (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | boolOr (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | boolXor (llvm::SMTSolverRef solver, const ExpressionValue &lhs, const ExpressionValue &rhs) |
ExpressionValue | fallbackBinaryOp (llvm::SMTSolverRef solver, mlir::Operation *op, const ExpressionValue &lhs, const ExpressionValue &rhs) |
Computes a solver expression based on the operation, but computes a fallback interval (which is just Entire, or unknown). | |
ExpressionValue | neg (llvm::SMTSolverRef solver, const ExpressionValue &val) |
ExpressionValue | notOp (llvm::SMTSolverRef solver, const ExpressionValue &val) |
ExpressionValue | boolNot (llvm::SMTSolverRef solver, const ExpressionValue &val) |
ExpressionValue | fallbackUnaryOp (llvm::SMTSolverRef solver, mlir::Operation *op, const ExpressionValue &val) |
mlir::raw_ostream & | operator<< (mlir::raw_ostream &os, const ExpressionValue &e) |
Tracks a solver expression and an interval range for that expression.
Used as a scalar lattice value.
Definition at line 45 of file IntervalAnalysis.h.
|
inline |
Definition at line 48 of file IntervalAnalysis.h.
|
inlineexplicit |
Definition at line 50 of file IntervalAnalysis.h.
|
inline |
Definition at line 53 of file IntervalAnalysis.h.
|
inline |
Definition at line 56 of file IntervalAnalysis.h.
|
inline |
Definition at line 58 of file IntervalAnalysis.h.
|
inline |
Definition at line 62 of file IntervalAnalysis.h.
|
inline |
Definition at line 60 of file IntervalAnalysis.h.
|
inline |
Fold two expressions together when overapproximating array elements.
Definition at line 73 of file IntervalAnalysis.h.
bool llzk::ExpressionValue::operator== | ( | const ExpressionValue & | rhs | ) | const |
Definition at line 33 of file IntervalAnalysis.cpp.
void llzk::ExpressionValue::print | ( | mlir::raw_ostream & | os | ) | const |
Definition at line 259 of file IntervalAnalysis.cpp.
|
inline |
Return the current expression with a new interval.
newInterval |
Definition at line 67 of file IntervalAnalysis.h.
|
friend |
Definition at line 51 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 101 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 164 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 223 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 172 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 180 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 125 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 75 of file IntervalAnalysis.cpp.
|
friend |
Computes a solver expression based on the operation, but computes a fallback interval (which is just Entire, or unknown).
Used for currently unsupported compute-only operations.
solver | |
op | |
lhs | |
rhs |
|
friend |
|
friend |
Compute the intersection of the lhs and rhs intervals, and create a solver expression that constrains both sides to be equal.
solver | |
lhs | |
rhs |
Definition at line 44 of file IntervalAnalysis.cpp.
|
friend |
Compute the union of the lhs and rhs intervals, and create a solver expression that constrains both sides to be equal.
solver | |
lhs | |
rhs |
|
friend |
Definition at line 93 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 67 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 209 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 216 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 164 of file IntervalAnalysis.h.
|
friend |
Definition at line 109 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 117 of file IntervalAnalysis.cpp.
|
friend |
Definition at line 59 of file IntervalAnalysis.cpp.