axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

## Re: [Axiom-developer] [Q] Function for testing for a part of the output?

 From: William Sit Subject: Re: [Axiom-developer] [Q] Function for testing for a part of the output? Date: Fri, 11 Feb 2005 04:12:06 -0500

```
Vladimir Bondarenko wrote:

> Say, I have  D(sin(z)^2, z) and the output is  2cos(z)sin(z)
>
> What is the easiest way to see, if the output has sin(z) ?
> Say, something like
>
> -> present?(sin(z), D(sin(z)^2, z))
> true

member?(sin(z), isTimes(D(sin(z)^2,z))
true

Of course this is not general, that is, it would be nice to have a parser that
returns the list of operators and atomic operands (in a nested tree, perhaps
lisp style) when an expression is given and then flattened. Using PATTERN
facilities, it is possible to do some fairly general parsing. In a way
reminscent of Mathematica, unfortunately, parsing depends on the functions
called, rather than the mathematics: that is, one must have a priori knowledge
of the form of the expression (in Mathematica, given by FullForm): sin(z)sin(z)
is different from sin(z)^2.

William

```

reply via email to

 [Prev in Thread] Current Thread [Next in Thread]