Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
manual:chapter3:symbolic [2019/01/30 06:02] claudio [Attributes] |
manual:chapter3:symbolic [2021/03/22 08:58] claudio |
||
---|---|---|---|
Line 59: | Line 59: | ||
Attributes are hints that the user can include in an expression to increase the knowledge that the system has about certain variables. For example, if variables '' | Attributes are hints that the user can include in an expression to increase the knowledge that the system has about certain variables. For example, if variables '' | ||
- | Attributes allow the user to let the system know that '' | + | Attributes allow the user to let the system know that '' |
+ | |||
+ | Notice that these attributes are only visible when editing the expression. Once the expression is in the stack, only the name of the variable will be visible. Ideally, the user should provide the same attributes to the same variables all throughout the expression (in other words, assumptions about a variable must be consistent, the variable cannot represents different things in different parts of the same expression). | ||
+ | |||
+ | The simplest way to assure the attributes are used consistently is using the command '' | ||
+ | |||
+ | Attributes are also useful within rules. If a variable (or wildcard special variable) has any attributes given within a rule definition, it will only match variables (or expressions) that have compatible attributes. For example a rule to cancel out factors in an expression could be: '' | ||
+ | |||
+ | === Default attributes === | ||
+ | |||
+ | Variables that aren't given any attributes are by default assumed to be real if complex mode is disabled, and complex if complex mode is enabled. No other assumptions are made about their value (could be in any range, could be zero or infinite, etc.). | ||
+ | |||
+ | === Encoding of attributes === | ||
+ | |||
+ | The syntax for attributes is intuitive but very strict. Trying to enter invalid attributes will result in a syntax error. | ||
+ | |||
+ | |||
+ | |||
+ | ==== Obsolete section - soon to be removed ==== | ||
+ | |||
+ | To add attributes to a variable, simply add a combination of subscript numbers after the variable name. For example, if '' | ||
Notice that these attributes are only visible when editing the expression. Once the expression is in the stack, only the name of the variable will be visible, as the subscript numbers don't become part of the name of the variable. Ideally, the user should provide the same attributes to the same variables all throughout the expression (otherwise the system will think the variable represents different things in different parts of the same expression). | Notice that these attributes are only visible when editing the expression. Once the expression is in the stack, only the name of the variable will be visible, as the subscript numbers don't become part of the name of the variable. Ideally, the user should provide the same attributes to the same variables all throughout the expression (otherwise the system will think the variable represents different things in different parts of the same expression). |