architxt.simplification.tree_rewriting.operations.operation

architxt.simplification.tree_rewriting.operations.operation#

Classes

Operation(*, tree_clusterer, min_support)

Abstract base class representing a tree rewriting operation.

class architxt.simplification.tree_rewriting.operations.operation.Operation(*, tree_clusterer, min_support)[source]#

Bases: ABC

Abstract base class representing a tree rewriting operation.

This class encapsulates the definition of operations that can be applied to a tree structure using certain equivalence subtrees, a threshold value, a minimum support value, and a metric function. It acts as the base class for any concrete operation and enforces the structure through abstract methods.

Parameters:

min_support (int) – The minimum support value for a structure to be considered frequent.

abstractmethod apply(tree)[source]#

Apply the rewriting operation on the given tree.

Parameters:

tree (Tree) – The tree to perform the reduction on.

Return type:

bool

Returns:

A boolean indicating whether the operation modified the tree (True) or left it unaltered (False).

get_class_support(equiv_class_name)[source]#
Return type:

int

get_equiv_of(tree)[source]#
Return type:

str | None

property name#
Return type:

str