Class StructuralMutatorWithConstraintContextObj#

Inheritance Relationships#

Base Type#

  • public tvm::ffi::StructuralMapEngineBase

Derived Type#

Class Documentation#

class StructuralMutatorWithConstraintContextObj : public tvm::ffi::StructuralMapEngineBase#

Mutates values using their structural mutation behavior while maintaining the constraint context relevant to each callback. Constraints use the resulting expressions and bindings.

Subclassed by tvm::tirx::ObjectMutatorWithConstraintContext

Public Types

using MutatorObjType = StructuralMutatorWithConstraintContextObj#
using StateTupleType = std::tuple<const sym::ConstraintContext&>#

Public Functions

inline StructuralMutatorWithConstraintContextObj()#

Construct a mutator using constraint-aware default descent.

inline void AppendConstraint(const sym::Constraint &constraint)#

Add a fact to the current scope, creating its child context on the first append.

Parameters:

constraint – Binding, range, or predicate valid in the current scope.

template<typename F>
inline decltype(f()) WithConstraintScope(F &&f)#

Run an Expected-returning callback in a constraint scope. Use AppendConstraint to add facts. Scopes without facts keep the incoming context. Success and visit interrupts restore the incoming position. Terminal errors propagate without restoration; discard the traversal context after failure.

inline ffi::Expected<ffi::UnchangedOr<ffi::Any>> DefaultMutateExpected(ffi::AnyView value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow) noexcept#

Default path, bypassing this node’s engine callback.

Public Members

sym::ConstraintContext constraints#

Active effective premises. Consumers must not append during traversal. Retain this handle and constraints->LocalSize() for a stable position, or use constraints->ToArray() for an independent sequence of handles. The context itself remains live.

Public Static Functions

static inline int32_t _GetOrAllocRuntimeTypeIndex()#
static inline int32_t RuntimeTypeIndex() noexcept#

Protected Functions

inline explicit StructuralMutatorWithConstraintContextObj(const ffi::StructuralMutatorVTable *vtable)#
inline StateTupleType StateTuple() const noexcept#