how to detect op integrate with intersect or lfreeof or??
Subject: how to detect op integrate with intersect or lfreeof or??
From: Stavros Macrakis
Date: Wed, 2 Nov 2011 14:41:28 -0400
Some Maxima operations have two forms, "noun" and "verb". To cover all
bases, try
intersect(lop_rr, {verbify('integrate),nounify('integrate)});
On Wed, Nov 2, 2011 at 14:34, Edwin Woollett <woollett at charter.net> wrote:
> How can I detect the op integrate using either
> intersect or lfreeof or ...?
>
> I am using Stavros Macrakis' code for listofops
> below:
> ------------------
> (%i1) display2d:false$
>
> (%i2) listofops(expr) := block([inflag:true], if mapatom(expr) then {} else
> adjoin(op(expr),xreduce(union,**maplist(listofops,expr))))$
>
> (%i3) rr : integrate(cos(log(x)/x)/x,x);
> (%o3) 'integrate(cos(log(x)/x)/x,x)
>
> (%i4) lop_rr : listofops(rr);
> (%o4) {"*","^",cos,integrate,log}
>
> (%i5) intersect(lop_rr, {cos});
> (%o5) {cos}
>
> (%i6) intersect(lop_rr, {integrate});
> (%o6) {}
>
> (%i7) ll : listify (lop_rr);
> (%o7) ["*","^",cos,integrate,log]
>
> (%i8) lfreeof(ll,cos);
> (%o8) false
>
> (%i9) lfreeof(ll,integrate);
> (%o9) true
> -------------------
>
> I have not been successful in using code like:
> --------------------------
> vx : apply ('integrate,[ue,uvar]),
> vxop : op(vx),
> if vxop # integrate then (
> if ua = minf then
> vxa : limit (vx,uvar,minf,plus)
> else vxa : subst(ua,uvar,vx),
> etc., etc. ----------------
> which can be illustrated interactively here:
> -----------------
> (%i10) rrop : op(rr);
> (%o10) integrate
>
> (%i11) if rrop # integrate then print("rrop # integrate");
> rrop # integrate (%o11) "rrop # integrate"
> -------------------------
> so I am looking for some reliable method of doing something
> in the code when the noun form in ***not*** returned from
> integrate (expr,var).
>
> Ted Woollett
>
>
>
>
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>
>