is facsum broken in 5.13.99rc1?



I think the facsum bug is due to a broken opmap function (defined in
/share/simplification/genut.mac). The change from symbol to string
operators causes a problem for way opmap uses (or abuses) ?getf.

/* LST is an alternating list of operators and associated functions.
   OP_FCN_LIST is used to pass LST to recursive calls to OPMAP. */

opmap_x(exp,lst) :=
  if atom(exp)
  then exp
  else block([fun:?getf(?cdr(lst),inpart(exp,0))],
    if fun#false
    then block([op_fcn_list:lst],
      apply(fun,[exp]))
    else exp)$

Proposed replacement:

opmap(exp, lst) := block([op_fcn_list : lst, e_op, x, fun : 'false, inflag
  : 'true],
  if mapatom(exp) then exp
  else (
    e_op : op(exp),
    while lst # [ ] do (
      x : first(lst),
      lst : rest(lst),
      if x = e_op and lst # [ ] then (
        fun : first(lst),
        lst : [ ])),
    if fun = 'false then exp else apply(fun, [exp])))$

Additionally, I changed atom to mapatom. I think this change is better for
things
like facsum(x[1], x[1]).

I think we need to fix facsum before a 5.14.0 release.

Barton