Enum Types.TypeExpr

    • 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 name
        NullPointerException - if the argument is null
      • oneOf

        public boolean oneOf​(Types.TypeExpr... types)
        Returns true iff this type is one of the specified types.
        Parameters:
        types - a sequence of types
        Returns:
        true iff this type is one of the specified types
      • notOneOf

        public boolean notOneOf​(Types.TypeExpr... types)
        Returns true iff this type is not one of the specified types.
        Parameters:
        types - a sequence of types
        Returns:
        true iff this type is not one of the specified types
      • isSymmetricOperator

        public boolean isSymmetricOperator()
        Returns true iff this type denotes an operator that is commutative (and also associative when it is a non-binary operator).
        Returns:
        true iff this type denotes an operator that is symmetric
      • isUnsymmetricRelationalOperator

        public boolean isUnsymmetricRelationalOperator()
        Returns true iff this type denotes a binary non-symmetric relational operator (i.e., LT, LE, GE and GT).
        Returns:
        true iff this type denotes a binary non-symmetric relational
      • isRelationalOperator

        public boolean isRelationalOperator()
        Returns true iff this type denotes a relational operator (i.e., LT, LE, GE, GT, EQ and NE).
        Returns:
        true iff this type denotes a relational operator
      • isUnaryArithmeticOrLogicOperator

        public boolean isUnaryArithmeticOrLogicOperator()
        Returns true iff this type denotes a unary arithmetic or logic operator (i.e., ABS, NEG, SQR, and NOT).
        Returns:
        true iff this type denotes a unary arithmetic or logic operator
      • isArithmeticOperator

        public boolean isArithmeticOperator()
        Returns true iff this type denotes a (non-unary) arithmetic operator (i.e., ADD, SUB, MUL, DIV, MOD, POW and DIST).
        Returns:
        true iff this type denotes a (non-unary) arithmetic operator
      • isLogicalOperator

        public boolean isLogicalOperator()
        Returns true iff this type denotes a (non-unary) logical operator (i.e., AND, OR, XOR, IFF, and IMP).
        Returns:
        true iff this type denotes a (non-unary) logical operator
      • isPredicateOperator

        public boolean isPredicateOperator()
        Returns true iff this type denotes an operator that evaluates to 0/1 (false/true).
        Returns:
        true iff this type denotes an operator that evaluates to 0/1 (false/true)
      • isIdentityWhenOneOperand

        public boolean isIdentityWhenOneOperand()
        Returns true iff 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, null otherwise. The arithmetic inversion is not obtained by applying a logical negation but a multiplication by -1. For example, the arithmetic inversion of LT is GT (and not GE). Also, the arithmetic inversion of EQ is EQ.
        Returns:
        the type denoting the arithmetic inversion of this type, if this type denotes a relational operator, null otherwise
      • 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), null otherwise. The logical inversion is different from the arithmetic inversion. For example, the logical inversion of LT is GE (and not GT). Also, the logical inversion of EQ is NE.
        Returns:
        the type denoting the logical inversion of this type, if this type denotes a a Boolean operator that can be inverted, null otherwise
      • isLogicallyInvertible

        public boolean isLogicallyInvertible()
        Returns true iff this type denotes an operator that can be logically inverted, null otherwise.
        Returns:
        true iff this type denotes an operator that can be logically inverted, null otherwise
      • toRelop

        public Types.TypeConditionOperatorRel toRelop()
        The type from TypeConditionOperatorRel with the same name as this type, if it exists, null otherwise.
        Returns:
        The type from TypeConditionOperatorRel with the same name as this type, if it exists, null otherwise
      • toSetop

        public Types.TypeConditionOperatorSet toSetop()
        The type from TypeConditionOperatorSet with the same name as this type, if it exists, null otherwise.
        Returns:
        The type from TypeConditionOperatorSet with the same name as this type, if it exists, null otherwise
      • toAriop

        public Types.TypeArithmeticOperator toAriop()
        The type from TypeArithmeticOperator with the same name as this type, if it exists, null otherwise.
        Returns:
        The type from TypeArithmeticOperator with the same name as this type, if it exists, null otherwise
      • toUnalop

        public Types.TypeUnaryArithmeticOperator toUnalop()
        The type from TypeUnaryArithmeticOperator with the same name as this type, if it exists, null otherwise.
        Returns:
        The type from TypeUnaryArithmeticOperator with the same name as this type, if it exists, null otherwise
      • toLogop

        public Types.TypeLogicalOperator toLogop()
        The type from TypeLogicalOperator with the same name as this type, if it exists, null otherwise.
        Returns:
        The type from TypeLogicalOperator with the same name as this type, if it exists, null otherwise