Re: suppressing interactive queries



On Tue, 15 Feb 2005 08:18:19 -0800 (PST), Robert Dodier
 wrote:
> On the other hand if assume_pos worked like this --
>  (%i1) assume_something_but_let_me_know_what_it_is: true$
>  (%i2) integrate (x^a, x, 1, inf);
>  (%o2)        if a < -1 then -1/(a + 1)

I think this does what you want:

block([assume_pos:true,
       assumptions: [],
       assume_pos_pred:
         lambda([q],if not member(q,assumptions)
                    then assumptions:cons(q,assumptions),
                    true),
       result],
     result: integrate(x^-n,x,1,inf) ,
     if assumptions # [] 
        then ('if funmake("and",
                          reverse(map(lambda([r],'"<"(0,r)),
                                      assumptions)))
               then result)
        else result)

A couple of problems:

1) the bug in assume_pos which has already been mentioned.
2) the lack of simplification for "and" etc.
3) the clumsy display of noun-form "if" and "and".

But other than that....

           -s