Package org.xcsp.common
Enum Types.TypeExpr
- java.lang.Object
-
- java.lang.Enum<Types.TypeExpr>
-
- org.xcsp.common.Types.TypeExpr
-
- All Implemented Interfaces:
Serializable,Comparable<Types.TypeExpr>
- Enclosing class:
- Types
public static enum Types.TypeExpr extends Enum<Types.TypeExpr>
The enum type specifying the different types of nodes that can be found in syntactic trees (built for intensional expressions).
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABSACOSADDANDASINATANCARDCONVEXCOSCOSHDECIMALDIFFDISTDIVDJOINTEQEXPFDIVFMODGEGTHULLIFIFFIMPININTERLELNLOGLONGLTMAXMINMODMULNENEGNOTNOTINNROOTORPARPOWRATIONALSDIFFSETSINSINHSPECIALSQRSQRTSUBSUBSEQSUBSETSUPSEQSUPSETSYMBOLTANTANHUNIONVARXOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Types.TypeExprarithmeticInversion()Returns the type denoting the arithmetic inversion of this type, if this type denotes a relational operator,nullotherwise.booleanisArithmeticOperator()Returnstrueiff this type denotes a (non-unary) arithmetic operator (i.e.,ADD, SUB, MUL, DIV, MOD, POW and DIST).booleanisIdentityWhenOneOperand()Returnstrueiff this type denotes an operator that behaves like identity if only one operand was given.booleanisLogicallyInvertible()Returnstrueiff this type denotes an operator that can be logically inverted,nullotherwise.booleanisLogicalOperator()Returnstrueiff this type denotes a (non-unary) logical operator (i.e.,AND, OR, XOR, IFF, and IMP).booleanisPredicateOperator()Returnstrueiff this type denotes an operator that evaluates to 0/1 (false/true).booleanisRelationalOperator()Returnstrueiff this type denotes a relational operator (i.e.,LT, LE, GE, GT, EQ and NE).booleanisSymmetricOperator()Returnstrueiff this type denotes an operator that is commutative (and also associative when it is a non-binary operator).booleanisUnaryArithmeticOrLogicOperator()Returnstrueiff this type denotes a unary arithmetic or logic operator (i.e.,ABS, NEG, SQR, and NOT).booleanisUnsymmetricRelationalOperator()Returnstrueiff this type denotes a binary non-symmetric relational operator (i.e.,LT, LE, GE and GT).Types.TypeExprlogicalInversion()Returns the type denoting the logical inversion of this type, if this type denotes a a Boolean operator (that can be inverted when considering the current pool of constants),nullotherwise.booleannotOneOf(Types.TypeExpr... types)Returnstrueiff this type is not one of the specified types.booleanoneOf(Types.TypeExpr... types)Returnstrueiff this type is one of the specified types.Types.TypeArithmeticOperatortoAriop()The type fromTypeArithmeticOperatorwith the same name as this type, if it exists,nullotherwise.Types.TypeLogicalOperatortoLogop()The type fromTypeLogicalOperatorwith the same name as this type, if it exists,nullotherwise.Types.TypeConditionOperatorReltoRelop()The type fromTypeConditionOperatorRelwith the same name as this type, if it exists,nullotherwise.Types.TypeConditionOperatorSettoSetop()The type fromTypeConditionOperatorSetwith the same name as this type, if it exists,nullotherwise.Types.TypeUnaryArithmeticOperatortoUnalop()The type fromTypeUnaryArithmeticOperatorwith the same name as this type, if it exists,nullotherwise.static Types.TypeExprvalueOf(String name)Returns the enum constant of this type with the specified name.static Types.TypeExpr[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NEG
public static final Types.TypeExpr NEG
-
ABS
public static final Types.TypeExpr ABS
-
SQR
public static final Types.TypeExpr SQR
-
ADD
public static final Types.TypeExpr ADD
-
SUB
public static final Types.TypeExpr SUB
-
MUL
public static final Types.TypeExpr MUL
-
DIV
public static final Types.TypeExpr DIV
-
MOD
public static final Types.TypeExpr MOD
-
POW
public static final Types.TypeExpr POW
-
DIST
public static final Types.TypeExpr DIST
-
MIN
public static final Types.TypeExpr MIN
-
MAX
public static final Types.TypeExpr MAX
-
LT
public static final Types.TypeExpr LT
-
LE
public static final Types.TypeExpr LE
-
GE
public static final Types.TypeExpr GE
-
GT
public static final Types.TypeExpr GT
-
NE
public static final Types.TypeExpr NE
-
EQ
public static final Types.TypeExpr EQ
-
SET
public static final Types.TypeExpr SET
-
IN
public static final Types.TypeExpr IN
-
NOTIN
public static final Types.TypeExpr NOTIN
-
NOT
public static final Types.TypeExpr NOT
-
AND
public static final Types.TypeExpr AND
-
OR
public static final Types.TypeExpr OR
-
XOR
public static final Types.TypeExpr XOR
-
IFF
public static final Types.TypeExpr IFF
-
IMP
public static final Types.TypeExpr IMP
-
IF
public static final Types.TypeExpr IF
-
CARD
public static final Types.TypeExpr CARD
-
UNION
public static final Types.TypeExpr UNION
-
INTER
public static final Types.TypeExpr INTER
-
DIFF
public static final Types.TypeExpr DIFF
-
SDIFF
public static final Types.TypeExpr SDIFF
-
HULL
public static final Types.TypeExpr HULL
-
DJOINT
public static final Types.TypeExpr DJOINT
-
SUBSET
public static final Types.TypeExpr SUBSET
-
SUBSEQ
public static final Types.TypeExpr SUBSEQ
-
SUPSEQ
public static final Types.TypeExpr SUPSEQ
-
SUPSET
public static final Types.TypeExpr SUPSET
-
CONVEX
public static final Types.TypeExpr CONVEX
-
FDIV
public static final Types.TypeExpr FDIV
-
FMOD
public static final Types.TypeExpr FMOD
-
SQRT
public static final Types.TypeExpr SQRT
-
NROOT
public static final Types.TypeExpr NROOT
-
EXP
public static final Types.TypeExpr EXP
-
LN
public static final Types.TypeExpr LN
-
LOG
public static final Types.TypeExpr LOG
-
SIN
public static final Types.TypeExpr SIN
-
COS
public static final Types.TypeExpr COS
-
TAN
public static final Types.TypeExpr TAN
-
ASIN
public static final Types.TypeExpr ASIN
-
ACOS
public static final Types.TypeExpr ACOS
-
ATAN
public static final Types.TypeExpr ATAN
-
SINH
public static final Types.TypeExpr SINH
-
COSH
public static final Types.TypeExpr COSH
-
TANH
public static final Types.TypeExpr TANH
-
VAR
public static final Types.TypeExpr VAR
-
PAR
public static final Types.TypeExpr PAR
-
LONG
public static final Types.TypeExpr LONG
-
RATIONAL
public static final Types.TypeExpr RATIONAL
-
DECIMAL
public static final Types.TypeExpr DECIMAL
-
SYMBOL
public static final Types.TypeExpr SYMBOL
-
SPECIAL
public static final Types.TypeExpr SPECIAL
-
-
Field Detail
-
lcname
public final String lcname
The name of this type in lower-case.
-
arityMin
public final int arityMin
The minimum arity (number of sons) for a node of this type.
-
arityMax
public final int arityMax
The maximum arity (number of sons) for a node of this type.
-
-
Method Detail
-
values
public static Types.TypeExpr[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Types.TypeExpr c : Types.TypeExpr.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Types.TypeExpr valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
oneOf
public boolean oneOf(Types.TypeExpr... types)
Returnstrueiff this type is one of the specified types.- Parameters:
types- a sequence of types- Returns:
trueiff this type is one of the specified types
-
notOneOf
public boolean notOneOf(Types.TypeExpr... types)
Returnstrueiff this type is not one of the specified types.- Parameters:
types- a sequence of types- Returns:
trueiff this type is not one of the specified types
-
isSymmetricOperator
public boolean isSymmetricOperator()
Returnstrueiff this type denotes an operator that is commutative (and also associative when it is a non-binary operator).- Returns:
trueiff this type denotes an operator that is symmetric
-
isUnsymmetricRelationalOperator
public boolean isUnsymmetricRelationalOperator()
Returnstrueiff this type denotes a binary non-symmetric relational operator (i.e.,LT, LE, GE and GT).- Returns:
trueiff this type denotes a binary non-symmetric relational
-
isRelationalOperator
public boolean isRelationalOperator()
Returnstrueiff this type denotes a relational operator (i.e.,LT, LE, GE, GT, EQ and NE).- Returns:
trueiff this type denotes a relational operator
-
isUnaryArithmeticOrLogicOperator
public boolean isUnaryArithmeticOrLogicOperator()
Returnstrueiff this type denotes a unary arithmetic or logic operator (i.e.,ABS, NEG, SQR, and NOT).- Returns:
trueiff this type denotes a unary arithmetic or logic operator
-
isArithmeticOperator
public boolean isArithmeticOperator()
Returnstrueiff this type denotes a (non-unary) arithmetic operator (i.e.,ADD, SUB, MUL, DIV, MOD, POW and DIST).- Returns:
trueiff this type denotes a (non-unary) arithmetic operator
-
isLogicalOperator
public boolean isLogicalOperator()
Returnstrueiff this type denotes a (non-unary) logical operator (i.e.,AND, OR, XOR, IFF, and IMP).- Returns:
trueiff this type denotes a (non-unary) logical operator
-
isPredicateOperator
public boolean isPredicateOperator()
Returnstrueiff this type denotes an operator that evaluates to 0/1 (false/true).- Returns:
trueiff this type denotes an operator that evaluates to 0/1 (false/true)
-
isIdentityWhenOneOperand
public boolean isIdentityWhenOneOperand()
Returnstrueiff this type denotes an operator that behaves like identity if only one operand was given.- Returns:
-
arithmeticInversion
public Types.TypeExpr arithmeticInversion()
Returns the type denoting the arithmetic inversion of this type, if this type denotes a relational operator,nullotherwise. The arithmetic inversion is not obtained by applying a logical negation but a multiplication by -1. For example, the arithmetic inversion ofLTisGT(and notGE). Also, the arithmetic inversion ofEQisEQ.- Returns:
- the type denoting the arithmetic inversion of this type, if this type denotes a relational operator,
nullotherwise
-
logicalInversion
public Types.TypeExpr logicalInversion()
Returns the type denoting the logical inversion of this type, if this type denotes a a Boolean operator (that can be inverted when considering the current pool of constants),nullotherwise. The logical inversion is different from the arithmetic inversion. For example, the logical inversion ofLTisGE(and notGT). Also, the logical inversion ofEQisNE.- Returns:
- the type denoting the logical inversion of this type, if this type denotes a a Boolean operator that can be inverted,
nullotherwise
-
isLogicallyInvertible
public boolean isLogicallyInvertible()
Returnstrueiff this type denotes an operator that can be logically inverted,nullotherwise.- Returns:
trueiff this type denotes an operator that can be logically inverted,nullotherwise
-
toRelop
public Types.TypeConditionOperatorRel toRelop()
The type fromTypeConditionOperatorRelwith the same name as this type, if it exists,nullotherwise.- Returns:
- The type from
TypeConditionOperatorRelwith the same name as this type, if it exists,nullotherwise
-
toSetop
public Types.TypeConditionOperatorSet toSetop()
The type fromTypeConditionOperatorSetwith the same name as this type, if it exists,nullotherwise.- Returns:
- The type from
TypeConditionOperatorSetwith the same name as this type, if it exists,nullotherwise
-
toAriop
public Types.TypeArithmeticOperator toAriop()
The type fromTypeArithmeticOperatorwith the same name as this type, if it exists,nullotherwise.- Returns:
- The type from
TypeArithmeticOperatorwith the same name as this type, if it exists,nullotherwise
-
toUnalop
public Types.TypeUnaryArithmeticOperator toUnalop()
The type fromTypeUnaryArithmeticOperatorwith the same name as this type, if it exists,nullotherwise.- Returns:
- The type from
TypeUnaryArithmeticOperatorwith the same name as this type, if it exists,nullotherwise
-
toLogop
public Types.TypeLogicalOperator toLogop()
The type fromTypeLogicalOperatorwith the same name as this type, if it exists,nullotherwise.- Returns:
- The type from
TypeLogicalOperatorwith the same name as this type, if it exists,nullotherwise
-
-