Interface ISymbol

    • Field Detail

      • CONSTANT

        static final int CONSTANT
        ISymbol attribute to indicate that a symbol has a constant value
        See Also:
        Constant Field Values
      • FLAT

        static final int FLAT
        ISymbol attribute for an associative function transformation. The evaluation of the function will flatten the arguments list
        See Also:
        Constant Field Values
      • HOLDFIRST

        static final int HOLDFIRST
        ISymbol attribute for a function, where the first argument should not be evaluated
        See Also:
        Constant Field Values
      • HOLDREST

        static final int HOLDREST
        ISymbol attribute for a function, where only the first argument should be evaluated
        See Also:
        Constant Field Values
      • HOLDALL

        static final int HOLDALL
        ISymbol attribute for a function, where no argument should be evaluated
        See Also:
        Constant Field Values
      • HOLDCOMPLETE

        static final int HOLDCOMPLETE
        ISymbol attribute for a function, where no argument should be evaluated
        See Also:
        Constant Field Values
      • SEQUENCEHOLD

        static final int SEQUENCEHOLD
        ISymbol attribute for a function, where no Sequence() argument should be flattend out
        See Also:
        Constant Field Values
      • HOLDALLCOMPLETE

        static final int HOLDALLCOMPLETE
        ISymbol attribute for a function, where no argument should be evaluated
        See Also:
        Constant Field Values
      • LISTABLE

        static final int LISTABLE
        ISymbol attribute for a function with lists as arguments
        See Also:
        Constant Field Values
      • NHOLDFIRST

        static final int NHOLDFIRST
        ISymbol attribute for a function, where the first argument should not be evaluated numerically
        See Also:
        Constant Field Values
      • NHOLDREST

        static final int NHOLDREST
        ISymbol attribute for a function, where the rest of the arguments should not be evaluated numerically.
        See Also:
        Constant Field Values
      • NHOLDALL

        static final int NHOLDALL
        ISymbol attribute for a function, which should not be evaluated numerically
        See Also:
        Constant Field Values
      • NOATTRIBUTE

        static final int NOATTRIBUTE
        ISymbol attribute which means that no attribute is set.
        See Also:
        Constant Field Values
      • NUMERICFUNCTION

        static final int NUMERICFUNCTION
        ISymbol attribute for a numeric function
        See Also:
        Constant Field Values
      • PACKAGE_LOADED

        static final int PACKAGE_LOADED
        ISymbol flag for a symbol which has already loaded it's package definition
        See Also:
        Constant Field Values
      • ONEIDENTITY

        static final int ONEIDENTITY
        ISymbol attribute for a function transformation: f(x) ==> x
        See Also:
        Constant Field Values
      • ORDERLESS

        static final int ORDERLESS
        ISymbol attribute for a commutative function transformation. The evaluation of the function will sort the arguments.
        See Also:
        Constant Field Values
      • FLATORDERLESS

        static final int FLATORDERLESS
        ISymbol attribute combination (ISymbol.FLAT and ISymbol.ORDERLESS)
        See Also:
        Constant Field Values
      • PROTECTED

        static final int PROTECTED
        ISymbol attribute for a symbol where no rule definition should be possible
        See Also:
        Constant Field Values
      • READPROTECTED

        static final int READPROTECTED
        ISymbol attribute for a symbol where the definition shouldn't be displayed
        See Also:
        Constant Field Values
      • LOCKED

        static final int LOCKED
        ISymbol attribute for a locked symbol. If a symbol is once locked, you cannot reset the lock.
        See Also:
        Constant Field Values
      • NO_EVAL_ENGINE_ATTRIBUTE

        static final int NO_EVAL_ENGINE_ATTRIBUTE
        A mask which tests if any evaluation engine attribute is sets
        See Also:
        Constant Field Values
      • DIRTY_FLAG_ASSIGNED_VALUE

        static final int DIRTY_FLAG_ASSIGNED_VALUE
        ISymbol flag to indicate that the symbols value is used by a method
        See Also:
        Constant Field Values
      • SETDELAYED_FLAG_ASSIGNED_VALUE

        static final int SETDELAYED_FLAG_ASSIGNED_VALUE
        ISymbol flag to indicate that the symbols value is defined by SetDelayed
        See Also:
        Constant Field Values
    • Method Detail

      • addAttributes

        void addAttributes​(int attributes)
        Add the attributes to the existing attributes bit-set.
        Parameters:
        attributes -
      • assignValue

        default void assignValue​(IExpr value)
        Set the OwnValues value of this variable. The value is assigned with the '=' operator.
        Parameters:
        value - the assigned 'right-hand-side' expression
      • assignValue

        void assignValue​(IExpr value,
                         boolean setDelayed)
        Set the OwnValues value of this variable
        Parameters:
        value - the assigned 'right-hand-side' expression
        setDelayed - if true, the value is assigned with the ':=' SetDelayed operator otherwise with the '=' operator.
      • assignedValue

        IExpr assignedValue()
        Get the OwnValues value which is assigned to the symbol or null, if no value is assigned.
        Returns:
        null, if no value is assigned.
      • clear

        void clear​(EvalEngine engine)
        Clear the associated rules (OwnValues, DownValues and UpValues ) for this symbol but don't clear the attribute flags.
        Parameters:
        engine - the evaluation engine
      • clearValue

        void clearValue()
        Clear the OwnValues value which is assigned to this symbol.
      • clearAll

        void clearAll​(EvalEngine engine)
        Clear all associated rules (OwnValues, DownValues and UpValues ) and attribute flags for this symbol.
        Parameters:
        engine - the evaluation engine
      • clearAttributes

        void clearAttributes​(int attributes)
        Remove the attribute flags from the existing attributes bit-set.
        Parameters:
        attributes -
      • clearEvalFlags

        void clearEvalFlags​(int flags)
        Remove the evaluation flags from the existing flags bit-set.
        Parameters:
        flags -
      • containsRules

        boolean containsRules()
        Check if ths symbol contains a "DownRule" or "UpRule"
        Returns:
        true if this symbol contains a "DownRule" or "UpRule"
      • createRulesData

        RulesData createRulesData​(int[] sizes)
        Create internal rules data structure with precalculated sizes
        • index 0 - number of equal rules in RULES
        Parameters:
        sizes -
      • definition

        IAST definition()
        Return a list of the rules associated to this symbol
        Returns:
      • definitionToString

        String definitionToString()
                           throws IOException
        Return the rules associated to this symbol in String representation
        Returns:
        the String representation of the symbol definition
        Throws:
        IOException
      • evalDownRule

        IExpr evalDownRule​(EvalEngine engine,
                           IExpr expression)
        Evaluate the given expression for the "down value" rules associated with this symbol
        Parameters:
        engine -
        expression -
        Returns:
        F.NIL if no evaluation was possible
      • evalMessage

        IExpr evalMessage​(String messageName)
      • evalUpRules

        IExpr evalUpRules​(IExpr expression,
                          EvalEngine engine)
        Evaluate the given expression for the "up value" rules (i.e. defined with UpSet and UpsetDelayed) associated with this symbol.
        Parameters:
        expression -
        engine -
        Returns:
        F.NIL if no evaluation was possible
      • get

        @Deprecated
        default IExpr get()
        Deprecated.
        use assignedValue() instead
        Get the value which is assigned to the symbol or null, if no value is assigned.
        Returns:
        null, if no value is assigned.
      • getAttributes

        int getAttributes()
        Get the Attributes of this symbol (i.e. LISTABLE, FLAT, ORDERLESS,...)
        Returns:
        See Also:
        FLAT
      • getContext

        Context getContext()
        Get the context this symbol is assigned to.
        Returns:
      • getDefaultValue

        IExpr getDefaultValue()
        Get the general default value for this symbol (i.e. 1 is the default value for Times, 0 is the default value for Plus). The general default value is used in pattern-matching for expressions like a_. * b_. + c_
        Returns:
        the default value or F.NIL if undefined.
      • getDefaultValue

        IExpr getDefaultValue​(int position)
        Get the default value at the arguments position for this symbol (i.e. 1 is the default value for Power at position 2). The default value is used in pattern-matching for expressions like a ^ b_.
        Parameters:
        position - the position for the default value
        Returns:
        the default value or F.NIL if undefined.
      • getRulesData

        RulesData getRulesData()
        Get the pattern matching rules associated with a symbol. RulesData contains DownValues and UpValues rules for pattern matching. Note: OwnValues are directly stored in a symbol.
        Returns:
        null if no rules are defined
      • getSymbolName

        String getSymbolName()
        Get the pure symbol name string without the context prefix.
        Returns:
      • getContextSymbolName

        default String getContextSymbolName()
        Get the full symbol name string with the context prefix included.
        Returns:
      • hasAssignedSymbolValue

        boolean hasAssignedSymbolValue()
        Is a (local or global) value assigned for this symbol?
        Returns:
        true if this symbol has an assigned value.
      • hasFlatAttribute

        boolean hasFlatAttribute()
        Does this symbols attribute set contains the Flat attribute?
        Returns:
        true if this symbols attribute set contains the Flat attribute.
      • hasHoldAllCompleteAttribute

        boolean hasHoldAllCompleteAttribute()
        Does this symbols attribute set contains the HOLDALLCOMPLETE attribute?
        Returns:
      • hasListableAttribute

        boolean hasListableAttribute()
        Does this symbols attribute set contains the Listable attribute?
        Returns:
        true if this symbols attribute set contains Theta Listable attribute.
      • hasFlatAttribute

        static boolean hasFlatAttribute​(int attributes)
        Does the attributes flag set contains the FLAT bit set?
        Returns:
        true if this attribute set contains the ISymbol.Flat attribute.
      • hasHoldAllCompleteAttribute

        static boolean hasHoldAllCompleteAttribute​(int attributes)
        Does the attributes flag set contains the HOLDALLCOMPLETE bit set?
        Parameters:
        attributes -
        Returns:
      • hasListableAttribute

        static boolean hasListableAttribute​(int attributes)
        Does the attributes flag set contains the LISTABLE bit set?
        Parameters:
        attributes -
        Returns:
      • hasOrderlessAttribute

        static boolean hasOrderlessAttribute​(int attributes)
        Does this symbols attribute set contains the Orderless attribute?
        Returns:
        true if this symbols attribute set contains the Orderless attribute.
      • hasOrderlessFlatAttribute

        static boolean hasOrderlessFlatAttribute​(int attributes)
        Does the attributes flag set contains the ISymbol.Flat and ISymbol.Orderless bits set?
        Returns:
        true if this attribute set contains the ISymbol.Flat and ISymbol.Orderless attribute.
      • hasOneIdentityAttribute

        boolean hasOneIdentityAttribute()
        Does this symbols attribute set contains the OneIdentity attribute?
        Returns:
        true if this symbols attribute set contains the OneIdentity attribute.
      • hasOrderlessAttribute

        boolean hasOrderlessAttribute()
        Does this symbols attribute set contains the Orderless attribute?
        Returns:
        true if this symbols attribute set contains the Orderless attribute.
      • hasOrderlessFlatAttribute

        boolean hasOrderlessFlatAttribute()
        Does this symbols attribute set contains the Flat and Orderless attribute?
        Returns:
        true if this symbols attribute set contains the Flat and the Orderless attribute.
      • isBooleanFormula

        default boolean isBooleanFormula()
        Test if this expression is a boolean formula (i.e. a symbol or a boolean function And, Equivalent, Nand, Nor, Not, Or, Xor where all arguments are also "boolean formulas")
        Specified by:
        isBooleanFormula in interface IExpr
        Returns:
        true, if the given expression is a boolean formula or a symbol.
        See Also:
        IExpr.isRealResult()
      • isContext

        default boolean isContext​(Context context)
        Gives true if this symbol is in the context.
        Returns:
      • isDollarSymbol

        default boolean isDollarSymbol()
        Returns:
        true if this is of type IBuiltInSymbol and the symbol name starts with a '$'; false otherwise.
      • isLocked

        boolean isLocked()
        Gives true if the system is in server mode and cannot be modified
        Returns:
      • isLocked

        boolean isLocked​(boolean packageMode)
        Gives true if the system is in server mode and cannot be modified
        Returns:
      • isNumericFunction

        default boolean isNumericFunction​(boolean allowList)
        Description copied from interface: IExpr
        Test if this expression is a numeric function (i.e. a number, a symbolic constant or a function (with attribute NumericFunction) where all arguments are also "numeric functions")
        Specified by:
        isNumericFunction in interface IExpr
        Parameters:
        allowList - if true a List(...) AST is seen, as if it has attribute NUMERICFUNCTION
        Returns:
        true, if the given expression is a numeric function or value.
        See Also:
        IExpr.isRealResult()
      • isNumericFunctionAttribute

        default boolean isNumericFunctionAttribute()
      • isOneIdentityAttribute

        default boolean isOneIdentityAttribute()
      • isProtected

        default boolean isProtected()
      • isString

        boolean isString​(String symbolName)
        Tests if this symbols name equals the given string
        Specified by:
        isString in interface IExpr
        Parameters:
        symbolName -
        Returns:
      • isSymbolName

        boolean isSymbolName​(String name)
        Returns true, if this symbol has the given name. The comparison of the symbols name with the given name is done according to the Config.PARSER_USE_LOWERCASE_SYMBOLS setting.
        Parameters:
        name - the symbol name
        Returns:
      • isSymbolID

        default boolean isSymbolID​(int... ids)
        Returns true, if this symbol is in the set of defined ids.
        Parameters:
        ids - the symbol ordinal number
        Returns:
        See Also:
        ID
      • linear

        default IExpr[] linear​(IExpr variable)
        Description copied from interface: IExpr
        If this is a linear expression a + b * x return the addend a at index 0 and the multiplicant b at index 1
        Specified by:
        linear in interface IExpr
        Parameters:
        variable - the variable x to check for linearity
        Returns:
        null if this is not a linear expression
      • linearPower

        default IExpr[] linearPower​(IExpr variable)
        Description copied from interface: IExpr
        If this is an expression of the form a + b * x^n with n integer, return the addend at index 0 and the multiplicant at index 1 and the exponent n at index 2.
        Specified by:
        linearPower in interface IExpr
        Parameters:
        variable - the variable x in the formula
        Returns:
        null if this is not an expression of the form a+b*x^n
      • mapConstantDouble

        default IExpr mapConstantDouble​(DoubleFunction<IExpr> function)
        If this symbol has attribute ISymbol.CONSTANT and the symbol's evaluator is of instance INumericConstant, then apply the constants double value to the given function and return the result, otherwise return F.NIL.
        Parameters:
        function - applys the function to a double value, resulting in an object of type IExpr.
        Returns:
        the resulting expression from the function or F.NIL.
        See Also:
        org.matheclipse.core.reflection.system.Abs, org.matheclipse.core.reflection.system.Ceiling, org.matheclipse.core.reflection.system.Floor
      • of

        IExpr of​(EvalEngine engine,
                 IExpr... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN).
        Parameters:
        engine - the current evaluation engine
        args - the arguments for which this function symbol should be evaluated
        Returns:
        the evaluated expression; if no evaluation was possible return the created input expression.
      • of

        IExpr of​(EvalEngine engine,
                 Object... args)
        Evaluate this symbol for the arguments converted to IExpr function symbol(expr1, expr2, .... ,exprN).
        Parameters:
        engine - the current evaluation engine
        args - the arguments for which this function symbol should be evaluated
        Returns:
        the evaluated expression; if no evaluation was possible return the created input expression
      • of1

        IExpr of1​(EvalEngine engine,
                  IExpr arg,
                  IExpr... parts)
        Evaluate this symbol for the arguments as function symbol(arg, part1, part2, .... , partN).
        Parameters:
        engine - the current evaluation engine
        arg - the main argument
        parts - the arguments for which this function symbol should be evaluated
        Returns:
        the evaluated expression; if no evaluation was possible return the created input expression.
      • of

        default IExpr of​(IExpr... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN).
        Parameters:
        args - the arguments for which this function symbol should be evaluated
        Returns:
        the evaluated expression; if no evaluation was possible return the created input expression.
      • of

        default IExpr of​(int... args)
        Evaluate this symbol for the arguments as function symbol(F.ZZ(arg1), F.ZZ(arg2), .... ,F.ZZ(argN)) by converting the args to IInteger objects.
        Parameters:
        args -
        Returns:
        the evaluated expression; if no evaluation was possible return the created input expression.
      • ofN

        default double ofN​(double... args)
                    throws ArgumentTypeException
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN), The args are converted from Java double to INum values.
        Parameters:
        args -
        Returns:
        Throws:
        ArgumentTypeException
      • of

        default IExpr of​(String... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN), The args are converted from Java String to IStringX values.
        Parameters:
        args - the string arguments of the function
        Returns:
      • of

        default IExpr of​(boolean... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN), The args are converted from Java boolean to S.True or S.False values.
        Parameters:
        args -
        Returns:
      • ofNIL

        IExpr ofNIL​(EvalEngine engine,
                    IExpr... args)
        This method returns F.NIL if no evaluation was possible. Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN).
        Parameters:
        engine - the current evaluation engine
        args - the arguments for which this function symbol should be evaluated
        Returns:
        F.NIL if no evaluation was possible.
      • ofQ

        boolean ofQ​(EvalEngine engine,
                    IExpr... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN) to a boolean value. If the result isn't a boolean value return false.
        Parameters:
        engine - the current evaluation engine
        args - the arguments for which this function symbol should be evaluated
        Returns:
        if the result isn't a boolean value return false.
      • ofQ

        boolean ofQ​(IExpr... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN) to a boolean value. If the result isn't a boolean value return false.
        Parameters:
        args - the arguments for which this function symbol should be evaluated
        Returns:
        if the result isn't a boolean value return false.
      • ofObject

        default IExpr ofObject​(Object... args)
        Evaluate this symbol for the arguments as function symbol(arg1, arg2, .... ,argN), The objects are converted from Java form to IExpr for according to method Object2Expr.convert(Object, boolean, boolean).
        Parameters:
        args - the objects which should be used as arguments
        Returns:
      • ordinal

        default int ordinal()
        Get the ordinal number of this built-in symbol in the enumeration of built-in symbols. If this is no built-in symbol return -1 (ID.UNKNOWN)
        Returns:
      • putDownRule

        default IPatternMatcher putDownRule​(int setSymbol,
                                            boolean equalRule,
                                            IAST leftHandSide,
                                            IExpr rightHandSide,
                                            boolean packageMode)
        Associate a new "down value" rule with default priority to this symbol.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        packageMode - true if we are on "package mode"
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • putDownRule

        IPatternMatcher putDownRule​(int setSymbol,
                                    boolean equalRule,
                                    IAST leftHandSide,
                                    IExpr rightHandSide,
                                    int priority,
                                    boolean packageMode)
        Associate a new rule with the given priority to this symbol.
        Rules with lower numbers have higher priorities.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        priority - the priority of the rule
        packageMode - true if we are on "package mode"
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • putDownRule

        default IPatternMatcher putDownRule​(int setSymbol,
                                            boolean equalRule,
                                            IPatternObject leftHandSide,
                                            IExpr rightHandSide,
                                            boolean packageMode)
        Associate a new "down value" rule with default priority to this symbol.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        packageMode - true if we are on "package mode"
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • putDownRule

        IPatternMatcher putDownRule​(int setSymbol,
                                    boolean equalRule,
                                    IPatternObject leftHandSide,
                                    IExpr rightHandSide,
                                    int priority,
                                    boolean packageMode)
        Associate a new rule with the given priority to this symbol.
        Rules with lower numbers have higher priorities.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        priority - the priority of the rule
        packageMode - true if we are on "package mode"
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • putDownRule

        @Deprecated
        void putDownRule​(PatternMatcherAndInvoker pmEvaluator)
        Deprecated.

        Associate a new rule, which invokes a method, to this symbol.

        Deprecated: don't use dynamically called methods.

        Parameters:
        pmEvaluator -
      • putMessage

        void putMessage​(int setSymbol,
                        String messageName,
                        IStringX message)
      • putUpRule

        IPatternMatcher putUpRule​(int setSymbol,
                                  boolean equalRule,
                                  IAST leftHandSide,
                                  IExpr rightHandSide)
        Associate a new "up value" rule with default priority to this symbol.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • putUpRule

        IPatternMatcher putUpRule​(int setSymbol,
                                  boolean equalRule,
                                  IAST leftHandSide,
                                  IExpr rightHandSide,
                                  int priority)
        Associate a new "up value" rule with the given priority to this symbol.
        Rules with lower numbers have higher priorities.
        Parameters:
        setSymbol - which of the symbols Set, SetDelayed, UpSet, UpSetDelayed was used for defining this rule
        equalRule - true if the leftHandSide could be matched with equality
        leftHandSide -
        rightHandSide -
        priority - the priority of the rule
        Returns:
        null if no pattern matcher was generated
        See Also:
        IPatternMap.DEFAULT_RULE_PRIORITY
      • reassignSymbolValue

        IExpr[] reassignSymbolValue​(Function<IExpr,​IExpr> function,
                                    ISymbol functionSymbol,
                                    EvalEngine engine)
        Apply the function to the currently assigned value of the symbol and reassign the result value to the symbol. Used for functions like AppendTo, AssociateTo, Decrement, Increment, PrependTo,...
        Parameters:
        function - the function which should be applied
        functionSymbol - if this method throws an exception the symbol will be displayed in the exceptions message
        engine - the evaluation engine
        Returns:
        an array with the currently assigned value of the symbol and the new calculated value of the symbol or null if the reassignment isn't possible.
      • reassignSymbolValue

        IExpr[] reassignSymbolValue​(IASTMutable ast,
                                    ISymbol functionSymbol,
                                    EvalEngine engine)
        Apply the ast to the currently assigned value of the symbol and reassign the result value to the symbol. Used for functions like AppendTo, Decrement, Increment,...
        Parameters:
        ast -
        ast - the ast which should be evaluated by replacing the first argument with the current value of the symbol
        functionSymbol - if this method throws an exception the symbol will be displayed in the exceptions message
        engine - the evaluation engine
        Returns:
        an array with the currently assigned value of the symbol and the new calculated value of the symbol or null if the reassignment isn't possible.
      • removeRule

        boolean removeRule​(int setSymbol,
                           boolean equalRule,
                           IExpr leftHandSide,
                           boolean packageMode)
        Remove the rules associate with this symbol, which equals the given leftHandSide expression.
        Parameters:
        setSymbol -
        equalRule -
        leftHandSide -
        packageMode -
        Returns:
        true if a rule could be removed, false otherwise
      • setAttributes

        void setAttributes​(int attributes)
        Set the Attributes of this symbol (i.e. LISTABLE, FLAT, ORDERLESS,...)
        Parameters:
        attributes - the Attributes of this symbol
      • setDefaultValue

        void setDefaultValue​(IExpr expr)
        Set the general default value for this symbol (i.e. 1 is the default value for Times, 0 is the default value for Plus). The general default value is used in pattern-matching for expressions like a_. * b_. + c_
        Parameters:
        expr - the general default value
        See Also:
        getDefaultValue()
      • setDefaultValue

        void setDefaultValue​(int position,
                             IExpr expr)
        Set the default value at the arguments position for this symbol (i.e. 1 is the default value for Power at position 2). The default value is used in pattern-matching for expressions like a ^ b_.
        Parameters:
        position - the position for the default value
        expr - the default value for the given position
        See Also:
        getDefaultValue(int)
      • setRulesData

        void setRulesData​(RulesData rd)
      • writeRules

        boolean writeRules​(ObjectOutputStream stream)
                    throws IOException
        Serialize the rule definitions associated to this symbol
        Parameters:
        stream -
        Returns:
        false if the symbol contains no rule definion.
        Throws:
        IOException