Package org.xcsp.common.predicates
Interface MatcherInterface
-
- All Known Implementing Classes:
MatcherInterface.Matcher
public interface MatcherInterface
This 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 class
MatcherInterface.AbstractOperation
static class
MatcherInterface.Matcher
This class allows us to perform matching tests between trees.
-
Field Summary
Fields Modifier and Type Field Description static XNodeLeaf<IVar>
add_mul_vals
static XNodeLeaf<IVar>
add_mul_vars
static XNodeLeaf<IVar>
add_vars
static XNodeLeaf<IVar>
any
static XNodeLeaf<IVar>
any_add_val
static XNodeLeaf<IVar>
anyc
static MatcherInterface.Matcher
k_mul_x
static XNodeLeaf<IVar>
logic_vars
static XNodeLeaf<IVar>
max_vars
static XNodeLeaf<IVar>
min_vars
static XNodeLeaf<IVar>
mul_vars
static XNodeLeaf<IVar>
not
static XNodeLeaf<IVar>
set_vals
static XNodeLeaf<IVar>
sub
static XNodeLeaf<IVar>
val
static XNodeLeaf<IVar>
var
static XNodeLeaf<IVar>
var_add_val
static XNodeLeaf<IVar>
varOrVal
static MatcherInterface.Matcher
x_mul_k
static MatcherInterface.Matcher
x_mul_y
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
matches(XNode<? extends IVar> tree)
Returnstrue
if the predefined target tree matches the specified (source) tree.default boolean
matching(XNode<? extends IVar> source, XNode<IVar> target, int level)
Returnstrue
if 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.boolean
validForSpecialTargetNode(XNode<? extends IVar> node, int level)
Returnstrue
if 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)
Returnstrue
if 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:
true
if 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)
Returnstrue
if 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:
true
if the specified source tree matches the specified target tree
-
-