@@ -184,13 +184,13 @@ select_apply([ex1]) := block([f1, ex, s1],
184184/* ********************************** */
185185
186186/* True if and only if ex is in the list l. */
187- element_listp(ex, l ) := any_listp(lambda([ex2], is(ex2=ex)), l )$
187+ element_listp(ex, _l ) := any_listp(lambda([ex2], is(ex2=ex)), _l )$
188188
189189/* all_listp(p,l) true if all elements of l satisfy p. */
190- all_listp(p, l ) := if listp(l ) then apply("and", maplist(p, l )) else error("all_listp expects its argument to be a list.")$
190+ all_listp(_p, _l ) := if listp(_l ) then apply("and", maplist(_p, _l )) else error("all_listp expects its argument to be a list.")$
191191
192192/* any_listp(p,l) true if all elements of l satisfy p. */
193- any_listp(p, l ) := if listp(l ) then apply("or", maplist(p, l )) else error("any_listp expects its argument to be a list.")$
193+ any_listp(_p, _l ) := if listp(_l ) then apply("or", maplist(_p, _l )) else error("any_listp expects its argument to be a list.")$
194194
195195/* Returns true iff a and b are lists (not necessarily same length) with one or more common elements, false o/w. */
196196listsoverlap(a, b) := not(emptyp(intersection(setify(a), setify(b))))$
@@ -199,10 +199,10 @@ listsoverlap(a, b) := not(emptyp(intersection(setify(a), setify(b))))$
199199listscontain(a, b, v) := elementp(v, intersection(setify(a), setify(b)))$
200200
201201/* Removes the first occurance of ex from the list l. */
202- removeonce(ex, l ) := block(
203- if listp(l )#true or emptyp(l ) then return([]),
204- if first(l )=ex then return(rest(l )),
205- append([first(l )], removeonce(ex,rest(l )))
202+ removeonce(ex, _l ) := block(
203+ if listp(_l )#true or emptyp(_l ) then return([]),
204+ if first(_l )=ex then return(rest(_l )),
205+ append([first(_l )], removeonce(ex,rest(_l )))
206206)$
207207
208208/* All the elements of l1, which do not occur in l2. Removes all occurances from l1, not one at a time. */
@@ -974,6 +974,7 @@ texput(binomial, binomialtex);
974974 24/11/13. Avoid fullratsimp. This expands out exprsssions such as (x+a)^6000, which results in an overflow.
975975 04/01/19. Avoid trigexpand too soon, i.e. before trying to factor.
976976 24/02/20. Using a lambda expression is causing an infinite loop. Use a named function: algebraic_equivalence_zero.
977+ 25/04/10. Change any_listp args to prevent an infinite loop.
977978*/
978979
979980algebraic_equivalence_zero(ex) := algebraic_equivalence(ex, 0)$
@@ -1034,6 +1035,7 @@ algebraic_equivalence(SA, SB) :=
10341035 ex:[ex],
10351036 if ex=[] then error("algebraic_equivalence: factoring the difference of two expressions threw an error."),
10361037 ex:ex[1],
1038+ if ex=0 then return(true),
10371039 /* Try to return a negative result without expanding anything! */
10381040 if safe_op(ex)="-" then
10391041 ex:first(args(ex)),
0 commit comments