MuPAD-FAQ-KNOWN_BUGS language

## Problems with ... in MuPAD ?

Also refer to How to ... in MuPAD ? where you can find hints how to work with MuPAD.

1. $-operator returns `"Invalid sign"` ?
2. Why is op(1/x,0)( op(1/x) ) <> 1/x ?
3. Unexpected evaluation in procedures ?

1. $-operator returns `"Invalid sign"` ?
   In some cases the $-operator returns the unexpected error message `"Invalid sign"`. Example:

       >> f:=1/_mult(i $ hold(i)=1..2);

       Error: Invalid sign [_seqgen]

   This problem bases on an internal data concept and cannot be solved as fast as it should. Please use the following work around:

       >> f:=_mult(i $ hold(i)=1..2); f:= 1/f;

                        2

                       1/2

2. Why is op(1/x,0)( op(1/x) ) <> 1/x ?
   This is not a bug! Because function op is used for explicit manipulations of formulars, no simplification is done. Therefore on the left side stands an unevaluated function call of _power whereas on the right side stands the value 1/x. If you want equality, you have to evaluate (simplify) the left side. Example:

       >> bool( op(1/x,0)(op(1/x)) = 1/x );

                     FALSE

       >> a:=op(1/x,0)(op(1/x)): bool( a = 1/x );

                     TRUE

3. Unexpected evaluation in procedures ?
   Results of evaluations in procedures may differ from those done in the global context. Example:

       >> reset(): a:=b: b:=c: c:=42:  a;  proc() begin a end_proc();

                      42

                       b

   This is not a bug! In the global context the substitution level is n>1 whereas in procedures the substitution level is set to 1. This has to be done to prevent side effects. If you need a higher substitution level then use the function level. Example:

       >> reset(): a:=b: b:=c: c:=42:  a;  proc() begin level(a,3) end_proc();

                      42

                      42