manual:chapter3:symbolic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous 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:47]
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 ''A'' and ''B'' in the expression ''%%'%%A*B*INV(A)%%'%%'' represent a matrix, the system should not simplify that expression to ''%%'%%B%%'%%''. Furthermore, if ''A'' and ''B'' are real numbers, the simplification is only valid when ''A'' is known not to be zero. 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 ''A'' and ''B'' in the expression ''%%'%%A*B*INV(A)%%'%%'' represent a matrix, the system should not simplify that expression to ''%%'%%B%%'%%''. Furthermore, if ''A'' and ''B'' are real numbers, the simplification is only valid when ''A'' is known not to be zero.
  
-Attributes allow the user to let the system know that ''A'' is a real number and it cannot be zero. To add attributes to a variable, simply add a combination of subscript numbers after the variable name. For example, if ''A'' is a real number known not to be zero, simply write ''A₂₁'' in the expression (the exact meaning of the numbers will be explained in the next section).+Attributes allow the user to let the system know that ''A'' is indeed a real number and it cannot be zero, allowing the rules to perform the desired simplificationsAttributes can simply be typed immediately after the variable name enclosed by colons. Following with the previous example ''%%'%%A:R>0:%%'%%'' is an identifier representing variable ''A'', but it includes a hint showing that ''A'' is a finite positive real value and cannot be zero. If that hint is included wherever ''A'' is used within the expression, the system will know that ''%%'%%A*B*INV(A)%%'%%'' can be safely simplified to ''%%'%%B%%'%%''
 + 
 +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 ''ASSUME''. For example ''%%'%%X^2+3*X%%'%% %%'X:R>0:'%% ASSUME'' will replace all occurrences of ''X'' within the expression given with the new identifier that includes the attributes. After the ''ASSUME'' command, trying to edit the expression will reveal the attributes: ''%%'%%X:R>0:^2+3*X:R>0:%%'%%'' which may make the expression more difficult to read. To remove the attributes, simply use an identifier without any attributes as the second argument: ''%%'%%X^2+3*X%%'%% %%'X'%% ASSUME'' will replace all occurrences of ''X'' with the new identifier which makes no assumptions (no attributes included). 
 + 
 + 
 +==== 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 ''A'' is a real number known not to be zero, simply write ''A₂₁'' in the expression (the exact meaning of the numbers will be explained in the next section).
  
 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).
  • manual/chapter3/symbolic.txt
  • Last modified: 2021/03/22 13:52
  • by claudio