limit direction for simplim%function



Am Dienstag, den 21.09.2010, 06:35 -0500 schrieb Barton Willis:
> Does the simplim%function mechanism allow for one-sided limits? For example, in bessel.lisp:
> 
>  (defprop %bessel_j simplim%bessel_j simplim%function)
> 
>  (defun simplim%bessel_j (expr var val)
>    ;; Look for the limit of the arguments.
>    (let ((v (limit (cadr expr) var val 'think))
> 
> The limit direction doesn't seem to be explicitly passed to the function limit. Is there a
> special variable that limit uses to determine the limit direction? The simplim%function dispatching
> defined in simplim, doesn't seem to explicitly know about the limit direction.

I know two different mechanism to get the direction of a one-sided limit
in a simplimit%function:

The direction is passed as an argument. The problem is transformed by
limit to a problem with the limit value $zeroa, when we come from above
and $zerob, when we come from below:

(%i20) limit(n!,n,-1,plus);
  0: (SIMPLIMFACT ((MFACTORIAL SIMP) ((MPLUS SIMP) -1 $N)) $N $ZEROA)
  0: SIMPLIMFACT returned $INF
(%o20)                                inf
(%i21) limit(n!,n,-1,minus);
  0: (SIMPLIMFACT ((MFACTORIAL SIMP) ((MPLUS SIMP) -1 $N)) $N $ZEROB)
  0: SIMPLIMFACT returned $MINF
(%o21)                               minf

The second method is to recalculate the direction of the limit. We have
some examples in the code, but I have not an example by the hand.

Dieter Kaiser