|
From: willisbl <wil...@us...> - 2025-11-19 16:45:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 31a22907ca4c85c8fc5093c5401f9a0a9ceefc41 (commit)
from 3f014279ab12b8bb23f47c601eb964e659cd7b99 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 31a22907ca4c85c8fc5093c5401f9a0a9ceefc41
Author: Barton Willis <wi...@un...>
Date: Wed Nov 19 10:45:25 2025 -0600
Fix for #3041 limit(inf*(zeroa+inf)) => und, should be inf
- In `toplevel-%limit`, use `expand(exp, 0, 0)` for constant expressions instead of `expand(exp, 1, 0)`.
Added a source code comment to explain this change.
- Unmarked `rest_limit_extra` test 111 as a known failure.
- Removed unused local `genfoo` from `toplevel-%limit`.
- Updated `rtest_limit.mac` test 159 to avoid `asksign`; test still fails.
- Corrected semantic failures in `rtest_abs_integrate.mac`.
No unexpected testsuite or share testsuite failures with SBCL 2.4.7 or Clozure CL 1.13.
diff --git a/share/contrib/integration/rtest_abs_integrate.mac b/share/contrib/integration/rtest_abs_integrate.mac
index c61ff5c84..258406eca 100644
--- a/share/contrib/integration/rtest_abs_integrate.mac
+++ b/share/contrib/integration/rtest_abs_integrate.mac
@@ -286,7 +286,7 @@ unit_box(x) := (unit_step(x) - unit_step(x-1)),0);
0$
f1 : convolution(unit_box(x),unit_box(x),x);
-(x*signum(x))/2-x*signum(x-1)+signum(x-1)+(x*signum(x-2))/2-signum(x-2)$
+(x*signum(x))/2-(signum(x-1)*(x-1))/2+2*signum(x-1)*(1/4-x/4)+2*signum(x-2)*((x-1)/4-1/4)$
integrate(f1,x,minf,inf);
1$
@@ -316,7 +316,7 @@ ceiling(x)$
0$
integrate(xx*floor(xx),xx,0,x);
--(floor(x)^3/6)-(floor(x)^2/4)+x^2*floor(x)/2-(floor(x)/12)$
+(x^2*floor(x))/2-(2*floor(x)^3+3*floor(x)^2+floor(x))/12$
diff(%,x);
x * floor(x)$
@@ -423,7 +423,7 @@ hypergeometric([2/3,4/3],[7/3],-((x-1)*(x^2+x+1))) *(x-1)*(x^2+x+1)*(1-x^3)^(1/3
(assume(0 < a), 0);
0$
-integrate(1/(1+abs(x)),x,-a,a);
+integrate(1/(1+abs(x)),x,-a,a),ratsimp;
2*log(a+1)$
(forget(0 < a),0);
@@ -700,10 +700,10 @@ integrate(1/(1+abs(x)),x,-1,1);
2*log(2)$
integrate(1/(1+abs(x)),x,-1/2,1/2);
-2*log(3/2)$
+(log(2)+log(3/2))/2-log(2)-((-log(2)-log(3/2))/2)+log(3/2)$
integrate(1/(1+abs(x)),x,-107,107);
-2*log(108)$
+(log(108)-log(106)-%i*%pi)/2+log(108)-((-log(108)+log(106)+%i*%pi)/2)+log(106)+%i*%pi$
/* bugs #3519 & #3641 */
integrate(abs(sin(x)),x,0,2*%pi);
diff --git a/src/limit.lisp b/src/limit.lisp
index 027867ee5..d6ad437f2 100644
--- a/src/limit.lisp
+++ b/src/limit.lisp
@@ -137,8 +137,7 @@
(logcombed ()) (lhp? ())
(varlist ()) (ans ()) (genvar ()) (loginprod? ())
(limit-answers ()) (limitp t) (simplimplus-problems ())
- (lenargs (length args))
- (genfoo ()))
+ (lenargs (length args)))
(declare (special lhcount *behavior-count-now* exp var val *indicator
taylored origval logcombed lhp?
varlist genvar loginprod? limitp))
@@ -154,7 +153,7 @@
;; The expression is 'T or 'NIL. Return immediately.
(return exp1))
(cond ((= lenargs 1)
- (setq var (setq genfoo (gensym)) ; Use a gensym. Not foo.
+ (setq var (gensym)
val 0))
(t
(setq var (second args))
@@ -221,16 +220,23 @@
;; Make assumptions about limit var being very small or very large.
;; Assumptions are forgotten upon exit.
(unless (= lenargs 1)
- (limit-context var val dr))
- ;; Resimplify in light of new assumptions. Changing ($expand exp 1 0)
- ;; to ($expand exp 0 0) results in a bad testsuite failure for
- ;; (assume(a>2), limit(integrate(t/log(t),t,2,a)/a,a,inf)) and
- ;; some testsuite results that are more messy.
+ (limit-context var val dr))
+
+ ;; Use $expand to resimplify `exp` in light of new assumptions. When `exp` is free of the limit
+ ;; `var`, perform pure simplification using ($expand exp 0 0) otherwise, call ($expand exp 1 0).
+ ;; Replacing ($expand exp 1 0) with ($expand exp 0 0) causes a serious testsuite failure for
+ ;; (assume(a > 2), limit(integrate(t/log(t), t, 2, a)/a, a, inf)) and produces messier results
+ ;; in other cases.
+
+ ;; Performing pure simplification for expressions free of the limit variable
+ ;; fixes the bug: limit(inf*(zeroa + inf)) -> und. Eventually, the call to ($expand exp 1 0)
+ ;; be replaced with ($expand exp 0 0) for all limit expressions `exp`.
+
(setq exp (resimplify
($minfactorial
(extra-simp
- ($expand exp 1 0)))))
-
+ ($expand exp (if ($freeof var exp) 0 1) 0)))))
+
(if (not (or (real-epsilonp val) ;; if direction of limit not specified
(infinityp val)))
(setq ans (both-side exp var val)) ;; compute from both sides
diff --git a/src/testsuite.lisp b/src/testsuite.lisp
index 2e47014ca..31e8a381b 100644
--- a/src/testsuite.lisp
+++ b/src/testsuite.lisp
@@ -135,7 +135,7 @@
"rtest_polynomialp"
((mlist simp) "rtest_limit_extra"
((mlist simp) 42 59 61 82 83 84 89
- 96 104 111
+ 96 104
124 125 126 127 132 133 135 136 137
224 238
239 240 241 242 243 244 245 246 249
diff --git a/tests/rtest_limit.mac b/tests/rtest_limit.mac
index 01e77a485..9656b8ff8 100644
--- a/tests/rtest_limit.mac
+++ b/tests/rtest_limit.mac
@@ -574,23 +574,20 @@ limit(1/inf-1/minf);
0;
/* 1-arg limit: limit(a*inf-inf) => minf - ID: 1385306
-These are long-standing bugs. The global `assume(a > 0)` shouldn't be needed, but removing it causes some
-calls to `asksign`. */
+These are long-standing bugs. For L1 & L2, the assumption 0 < a shouldn't be needed, but without it,
+Maxima does an asksign. */
block([L1,L2,L3,L4,L5,L6],
map('forget, facts(a)),
- assume(a > 0),
- L1 :limit(a*inf-inf),
+ assume(0 < a, a < 1),
+ L1 : limit(a*inf-inf),
L2 : limit((a-1)*inf),
- assume(a<1),
+ forget(0 < a, a < 1),
+ assume(a > 1),
L3 : limit(a*inf-inf),
L4 : limit((a-1)*inf),
- forget(a < 1),
- assume(a > 1),
- L5 : limit(a*inf-inf),
- L6 : limit((a-1)*inf),
- forget(a > 0),
- [L1,L2,L3,L4,L5,L6]);
-[und, und, minf, minf,inf,inf]$
+ forget(a > 1),
+ [L1,L2,L3,L4]);
+ [minf, minf, inf,inf]$
/* limit(1 - (-1/2)^inf) --> inf - ID: 2853506 */
limit(1 - (-1/2)^inf);
-----------------------------------------------------------------------
Summary of changes:
share/contrib/integration/rtest_abs_integrate.mac | 10 ++++-----
src/limit.lisp | 26 ++++++++++++++---------
src/testsuite.lisp | 2 +-
tests/rtest_limit.mac | 21 ++++++++----------
4 files changed, 31 insertions(+), 28 deletions(-)
hooks/post-receive
--
Maxima CAS
|