public interface IPatternObject extends IExpr
ASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
Modifier and Type | Method and Description |
---|---|
int[] |
addPattern(PatternMap patternMap,
java.util.Map<IExpr,java.lang.Integer> patternIndexMap)
Add this pattern to the given
patternMap and patternIndexMap . |
boolean |
equivalent(IPatternObject patternExpr2,
PatternMap pm1,
PatternMap pm2)
Check if the two left-hand-side pattern expressions are equivalent.
|
IExpr |
getCondition()
Get the associated condition if available
|
int |
getEvalFlags()
Get the flags which should be set in an AST structure, if the structure contains a pattern or pattern sequence.
|
int |
getIndex(PatternMap pm)
Get the pattern-matchers index in the
PatternMap |
ISymbol |
getSymbol()
Get the associated symbol for this pattern-object
|
boolean |
matchPattern(IExpr expr,
PatternMap patternMap)
Check if this pattern object matches the given
expr . |
$div, $minus, $plus, $times, $up, accept, accept, accept, accept, and, apply, apply, asType, compareTo, dec, divide, evalComplex, evalDouble, evalNumber, evalSignedNumber, evaluate, evaluateHead, fullFormString, getAt, getField, head, hierarchy, ifPresent, inc, internalFormString, internalJavaString, internalScalaString, inverse, isAllExpanded, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isBlank, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDerivative, isDirectedInfinity, isE, isExpanded, isFalse, isFlatAST, isFraction, isFree, isFree, isFree, isFreeAST, isFreeAST, isFreeOfPatterns, isFunction, isGEOrdered, isGTOrdered, isIndeterminate, isInfinity, isInteger, isIntegerResult, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegative, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumEqualInteger, isNumEqualRational, isNumeric, isNumericFunction, isNumericMode, isNumIntValue, isOne, isONE, isOr, isOrderlessAST, isPattern, isPatternDefault, isPatternExpr, isPatternSequence, isPi, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, isPositive, isPositiveResult, isPower, isPresent, isRational, isRationalResult, isRationalValue, isRealResult, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSpan, isSymbol, isTan, isTanh, isTimes, isTrue, isUnit, isValue, isVariable, isVector, isZero, isZERO, leafCount, leaves, minus, mod, multiply, multiply, negative, ofNullable, opposite, optional, or, orElse, orElseGet, orElseThrow, plus, power, power, reciprocal, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, times, timesDistributed, topHead, variables2Slots
int[] addPattern(PatternMap patternMap, java.util.Map<IExpr,java.lang.Integer> patternIndexMap)
patternMap
and patternIndexMap
.patternMap
- a map from a pattern to a possibly found value during pattern-matching.patternIndexMap
- a map from the pattern symbol to the intern array indexboolean equivalent(IPatternObject patternExpr2, PatternMap pm1, PatternMap pm2)
f[x_,y_]
is equivalent to
f[a_,b_]
)patternExpr1
- patternExpr2
- pm1
- pm2
- IExpr getCondition()
null
if no condition is associated.int getEvalFlags()
int getIndex(PatternMap pm)
PatternMap
pm
- the PatternMap from which we determine the index.ISymbol getSymbol()
boolean matchPattern(IExpr expr, PatternMap patternMap)
expr
.expr
- the expression which should be matched.patternMap
- a map from a pattern to a possibly found value during pattern-matching.