|
tvm
|
Tracks the constraints relevant to each point in a traversal. More...
#include <constraint.h>
Public Member Functions | |
| ConstraintContextObj ()=default | |
| Construct an empty root context. | |
| ConstraintContextObj (ffi::ObjectPtr< ConstraintContextObj > parent, int64_t parent_prefix_size) | |
| Capture an inherited prefix and start an empty local sequence. | |
| ConstraintContextObj (const ConstraintContextObj &)=delete | |
| ConstraintContextObj & | operator= (const ConstraintContextObj &)=delete |
| void | Append (const Constraint &constraint) |
| Append a premise locally, preserving every previously captured prefix. | |
| int64_t | LocalSize () const |
| Count the local entries. | |
| ConstraintContext | Snapshot () const |
| Captures the constraints currently visible in this context. Later additions to this context do not affect the returned context, which can be extended independently. Constraint objects and referenced expressions remain shared. For an existing integer expression x: | |
| template<typename F > | |
| void | ForEach (F &&f) const |
| Read constraints in inherited/local order. Later appends do not enter this iteration. The reference passed to the callback is valid only during that invocation; copy the handle to retain the premise. | |
| ffi::Array< Constraint > | ToArray () const |
| Returns an independent array of the constraints in this context. Includes inherited constraints in order. Later additions to the context do not change the returned array. Edits to the array do not change this context. Constraint objects remain shared and must not be mutated through aliases. | |
| TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("sym.ConstraintContext", ConstraintContextObj, ffi::Object) | |
Static Public Member Functions | |
| static void | RegisterReflection () |
| Register the context methods exposed through FFI reflection. | |
Static Public Attributes | |
| static constexpr bool | _type_mutable = true |
| Allow appending through a const context handle. | |
Friends | |
| class | AnalyzerObj |
Tracks the constraints relevant to each point in a traversal.
Holds variable bindings, value ranges, and predicates collected during traversal. Callbacks can inspect these constraints when processing the current expression or statement. Captured constraint and expression nodes must not be changed through aliases: appending preserves earlier prefixes, but snapshots do not deep-copy their contents.
|
default |
Construct an empty root context.
|
inline |
Capture an inherited prefix and start an empty local sequence.
| parent | Non-null parent context. |
| parent_prefix_size | Number of parent-local entries to capture. |
| ffi::Error | If parent is null or the prefix is outside [0, parent->LocalSize()]. |
|
delete |
|
inline |
Append a premise locally, preserving every previously captured prefix.
| constraint | Premise to retain as supplied, without validation or inference. Its node and referenced expressions must not later be mutated through aliases. |
|
inline |
Read constraints in inherited/local order. Later appends do not enter this iteration. The reference passed to the callback is valid only during that invocation; copy the handle to retain the premise.
| F | Callable accepting a const Constraint&. |
| f | Callback invoked once per captured premise, in inherited/local order. |
|
inline |
Count the local entries.
|
delete |
|
static |
Register the context methods exposed through FFI reflection.
|
inline |
Captures the constraints currently visible in this context. Later additions to this context do not affect the returned context, which can be extended independently. Constraint objects and referenced expressions remain shared. For an existing integer expression x:
|
inline |
Returns an independent array of the constraints in this context. Includes inherited constraints in order. Later additions to the context do not change the returned array. Edits to the array do not change this context. Constraint objects remain shared and must not be mutated through aliases.
| tvm::sym::ConstraintContextObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL | ( | "sym.ConstraintContext" | , |
| ConstraintContextObj | , | ||
| ffi::Object | |||
| ) |
|
friend |
|
staticconstexpr |
Allow appending through a const context handle.