[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] [Q] Function for testing for a partof the output?
From: |
William Sit |
Subject: |
Re: [Axiom-developer] [Q] Function for testing for a partof the output? |
Date: |
Fri, 11 Feb 2005 05:54:55 -0500 |
Bill's solution of course is mathematically sound if what one is looking for is
a kernel, and is preferrable. However, if one really wants to check some strings
embedded, then the following would work:
match?("*sss*",tex(ooo::TEX).1,char("*"))
where sss is what you are searching for (perhaps "texified", like \%\% for %%),
and ooo is the output of a computation. One advantage is we do not have to know
the structure of the output and so can be applied uniformly to all outputs.
There seems to be a bug with match (without the ?), which is supposed to return
the index if the string match succeeds. But
match("*to*","yorktown",char("*"))
>> System error:
Wildcard must be a character
protected-symbol-warn called with (NIL)
Also, the interpreter will not coerce "*" to a character.
William
---
"Page, Bill" wrote:
> On Thursday, February 10, 2005 4:58 PM Vladimir Bondarenko wrote:[
>
> > Please help also about the following where I have tried
> > several variations but without result
> >
> > -> member?(integrate,kernels(integrate(erf(z)*sin(z)^2,z)))
> >
> > false
>
> Try this:
>
> is?(integrate(erf(z)*sin(z)^2,z),integral)
>
> which tests that the first expression is a kernel with
> the operator integral.
>
> > while I'd like to have a test1 working like this
> >
> > -> test1(integrate, integrate(erf(z)*sin(z)^2,z))
> >
> > true -- Currently, AXIOM cannot get this integral and
> > -- returns it unevaluated
>
> Perhaps this is a little more accurate:
>
> not empty? [i for i in kernels integrate(erf(z)*sin(z)^2,z)
> | is?(i,integral)]
>
> which will be true if at least one integral remains.
>
> > and
> >
> > -> test2(%%, integrate(1/(a+z^5), z))
> > true -- Currently, AXIOM returns the terms like %%ID1
>
> not empty? [i for i in kernels integrate(1/(a+z^5), z)
> | is?(i,rootOf)]
>
> > Let me thank you cordially for your valuable help in advance.
>
> Of course you are most welcome!
>
> Regards,
> Bill Page.