How to recognize functional operator

Hello,

I have small script that uses syntax checker mint and latex command and latex to convert an expression in maple syntax to an image. But functional operators are causing me troubles.

Suppose I want to enter the equation  (x+1)*(x-1) and I forgot to use the star (*) for multiplication. The result (x+1)(x-1) is also correct because Maple thinks that I am using functional operator x. But I would like to evaluate this cas as wrong syntax. So I have to detect functional operators (somehow) but I don't want to detect operators such as +, -, * and so on.

Any idea? Thanks for help.

Robert Israel's picture

functional operators

If Q is an expression,

indets(Q, And(function, Not (typefunc(anything,mathfunc))))
 

will contain all function calls that Maple does not recognize as mathematical
functions.  In particular,

> Q := (x+1)(x-1);
   indets(Q, And(function, Not (typefunc(anything,mathfunc))));

       {x(x-1)}

However, this won't help you with something like 3(x-1), which is just evaluated as 3.

Thank you. It seems to be

Thank you. It seems to be sufficient solution. Equations like 3(x-1) can be detected by mint syntax checker.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}