Package org.xcsp.common.predicates
Interface MatcherInterface
-
- All Known Implementing Classes:
MatcherInterface.Matcher
public interface MatcherInterfaceThis interface is used to test if a specified (source) tree matches a predefined target tree. Some kind of abstraction can be used by means of special nodes.- Author:
- Christophe Lecoutre
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMatcherInterface.AbstractOperationstatic classMatcherInterface.MatcherThis class allows us to perform matching tests between trees.
-
Field Summary
Fields Modifier and Type Field Description static XNodeLeaf<IVar>add_mul_valsstatic XNodeLeaf<IVar>add_mul_varsstatic XNodeLeaf<IVar>add_varsstatic XNodeLeaf<IVar>anystatic XNodeLeaf<IVar>any_add_valstatic XNodeLeaf<IVar>anycstatic MatcherInterface.Matcherk_mul_xstatic XNodeLeaf<IVar>logic_varsstatic XNodeLeaf<IVar>max_varsstatic XNodeLeaf<IVar>min_varsstatic XNodeLeaf<IVar>mul_varsstatic XNodeLeaf<IVar>notstatic XNodeLeaf<IVar>set_valsstatic XNodeLeaf<IVar>substatic XNodeLeaf<IVar>valstatic XNodeLeaf<IVar>varstatic XNodeLeaf<IVar>var_add_valstatic XNodeLeaf<IVar>varOrValstatic MatcherInterface.Matcherx_mul_kstatic MatcherInterface.Matcherx_mul_y
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanmatches(XNode<? extends IVar> tree)Returnstrueif the predefined target tree matches the specified (source) tree.default booleanmatching(XNode<? extends IVar> source, XNode<IVar> target, int level)Returnstrueif the specified source tree matches the specified target tree (at the specified level).XNode<IVar>target()Returns the target tree, which may possibly involve some form of abstraction by means of special nodes.booleanvalidForSpecialTargetNode(XNode<? extends IVar> node, int level)Returnstrueif the specified node (considered at the specified level/depth) is valid with respect to the target tree when assuming that the corresponding node in the target tree is a special node.
-
-
-
Field Detail
-
x_mul_k
static final MatcherInterface.Matcher x_mul_k
-
x_mul_y
static final MatcherInterface.Matcher x_mul_y
-
k_mul_x
static final MatcherInterface.Matcher k_mul_x
-
-
Method Detail
-
target
XNode<IVar> target()
Returns the target tree, which may possibly involve some form of abstraction by means of special nodes.- Returns:
- the target tree
-
validForSpecialTargetNode
boolean validForSpecialTargetNode(XNode<? extends IVar> node, int level)
Returnstrueif the specified node (considered at the specified level/depth) is valid with respect to the target tree when assuming that the corresponding node in the target tree is a special node.- Parameters:
node- a (source) nodelevel- the level/depth associated with the node- Returns:
trueif the specified source node is valid with respect to a corresponding special node in the target tree
-
matching
default boolean matching(XNode<? extends IVar> source, XNode<IVar> target, int level)
Returnstrueif the specified source tree matches the specified target tree (at the specified level).- Parameters:
source- the source (sub-)treetarget- the target (sub-)treelevel- the level/depth for the comparison- Returns:
trueif the specified source tree matches the specified target tree
-
-