{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Couri er" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 8 "Advice: " }{TEXT -1 30 "Changing assumptions and names" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 186 "Strange things happen to an expression containing a variable on which assumptions ha ve been made, when those assumptions are changed or a value is assigne d to the variable. For example:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "assume(x > 0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "a: = x+1:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "additionally(x < \+ 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "a-x;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(%#x|irG\"\"\"F%F%%#x|irG!\"\"" }}}{PARA 0 "" 0 " " {TEXT -1 243 "This effect is due to the fact that when an assumption is made about a variable, the name of that variable is changed. If t he \"Trailing Tildes\" option for assumed variables is being used (whi ch is the default), the new name is printed with a " }{MPLTEXT 0 21 1 "~" }{TEXT -1 232 ". The name change occurs even without this option \+ (the option has only a cosmetic effect, changing how the name is print ed) . This is an illustration of the fact that two names that look th e same to us can be different to Maple. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "assume(x,integer);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "x;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%#x|irG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "about(x);" }}{PARA 6 "" 1 "" {TEXT -1 25 "Originally x, renamed x~:" }}{PARA 6 "" 1 "" {TEXT -1 27 " is assumed to be: integer" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 86 "The old name is assigned the new name as \+ its value. Thus when you enter and evaluate " }{MPLTEXT 0 21 1 "x" } {TEXT -1 29 ", you obtain the new name. " }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 6 "'x'-x;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&%\"xG\" \"\"%#x|irG!\"\"" }}}{PARA 0 "" 0 "" {TEXT -1 40 "Here we delayed eval uation of the first " }{MPLTEXT 0 21 1 "x" }{TEXT -1 46 " by putting i t in forward quotes. The second " }{MPLTEXT 0 21 1 "x" }{TEXT -1 183 " was evaluated normally. The result is the difference of two distinc t variables, instead of 0. If evaluation is allowed to occur (e.g. by recalling the last result), we do get 0. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "%;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}} {PARA 0 "" 0 "" {TEXT -1 121 "The new name can't be entered directly f rom the keyboard: it is not the same as what you get by entering the s tring `x~`." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "`x~`-x;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#,&%#x|irG\"\"\"%#x|irG!\"\"" }}}{PARA 0 "" 0 "" {TEXT -1 38 "Now if a new assumption is made about " } {MPLTEXT 0 21 1 "x" }{TEXT -1 7 " using " }{MPLTEXT 0 21 6 "assume" } {TEXT -1 4 " or " }{MPLTEXT 0 21 12 "additionally" }{TEXT -1 26 ", we \+ get another new name " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 56 " that is di fferent from the previous one. The original " }{MPLTEXT 0 21 1 "x" } {TEXT -1 80 " is assigned this as a value, so when any expression that contains the original " }{MPLTEXT 0 21 1 "x" }{TEXT -1 22 " is evalua ted the new " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 33 " will be used. But \+ the previous " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 94 " is left unchanged, so that evaluation of an expression that contains it will not use the new " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 28 ". Similarly, if you assign " }{MPLTEXT 0 21 1 "x" }{TEXT -1 56 " a value you are not affecting e xpressions that contain " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "A cure fo r these problems is to assign the new " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 29 " or the new value to the old " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 15 " as well as to " }{MPLTEXT 0 21 1 "x" }{TEXT -1 74 ". It can be d one as follows. Note that we must save the name of the old " } {MPLTEXT 0 21 2 "x~" }{TEXT -1 60 " in a variable before changing the \+ assumption. We then use " }{MPLTEXT 0 21 6 "assign" }{TEXT -1 13 " ra ther than " }{MPLTEXT 0 21 2 ":=" }{TEXT -1 55 " because we want to ma ke an assignment to the value of " }{MPLTEXT 0 21 4 "oldx" }{TEXT -1 31 " (which is the name of the old " }{MPLTEXT 0 21 2 "x~" }{TEXT -1 17 ") rather than to " }{MPLTEXT 0 21 4 "oldx" }{TEXT -1 8 " itself." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "assume(x > 0);\na:= x+1:\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "oldx:= x:\nadditionally (x < 2);\nassign(oldx,x):\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "a-x;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{PARA 0 "" 0 "" {TEXT -1 41 "Similarly, this technique will work when " }{MPLTEXT 0 21 1 "x" }{TEXT -1 99 " is being assigned a value. But the simplest t hing to do in that case is to assign the value with " }{MPLTEXT 0 21 6 "assign" }{TEXT -1 13 " rather than " }{MPLTEXT 0 21 2 ":=" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "assign(x,2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "a;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"$" }}}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also :" }{TEXT -1 1 " " }{HYPERLNK 17 "about" 2 "about" "" }{TEXT -1 2 ", \+ " }{HYPERLNK 17 "assign" 2 "assign" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "assume" 2 "assume" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "Error: cannot a ssume on a constant object" 2 "Error:cannot_assume_on_a_constant_objec t" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "Obtaining properties of objects " 2 "Obtaining_properties_of_objects" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 24 "Maple Advisor Database, " }{TEXT -1 15 " R. Israel 1997" }}}}{MARK "2 0 0" 4 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }