defint1 abs trouble



-----maxima-bounces at math.utexas.edu wrote: -----

On Mar. 18, Barton Willis wrote:
-----------------------------
>>(%i155) assume(x>0)$
>>
>> (%i156) mydefint1(abs(x),x,-1,1);
>> (%o156) 0
-------------------------------------
>Thanks for pointing out this further ?problem
>with mydefint1, ?an effort to ignore global
>assumptions and use local assumptions.

Switching mydefint1 to a macro (a ::= function) doesn't fix this (a macro prevents 
evaluation, but not simplification, of the arguments). 

By the way: a bug with translation of Maxima macros:

  (%i1) sally(a) ::= (?print(a),print(a),a)$

Input '(sin(0)) is correctly simplified to 0:

 (%i2) sally('(sin(0)));
 ((MQUOTE SIMP) 0) 
 '0
 (%o2) 0

Translate macro

 (%i3) translate(sally)$

Oops--argument isn't simplified (this is a translate bug).

 (%i4) sally('(sin(0)));
 ((MQUOTE) ((%SIN) 0)) 
 '(sin(0))
 (%o4) 0

The only way I know get (assume(x>0), mydefint1(abs(x),x,-1,1)) --> 1 is to write
mydefint1 as a CL defmspec function. I don't know this is possible using the Maxima
language. 

Example of a defmspec function:

(defmspec $patsy (x) 
  (setq x (first (margs x)))
  (print x) ($print x) x)

(%i12) patsy(sin(0));
((%SIN) 0)  sin(0)
(%o12) 0

--bw