From: <noreply@so...>  20021119 19:48:23

Bugs item #635627, was opened at 20021108 13:35 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=635627&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: subst([...] is orderdependent Initial Comment: I would have expected subst([a=...,b=...],...) to substitute a and b simultaneously (like Lisp Sublis), but it does not, and it simplifies along the way. Here are some cases where it matters. The most obvious case is subst([b=c,a=b],b) => c This means that subst cannot be used to permute variables, e.g. subst([x=y,y=x],...) That is not good.  But there are other cases:  subst([a=0,b=0],atan2(a,b)) Depending on the answers to a>0 etc., this can return 0 or %pi, whereas subst([b=0,a=0],...) can return pi/2 or  pi/2. I believe that it should give the error: atan2(0.0) has been generated.  subst(["="="+","["="*"],[x=1,x=2]); gives (x+1) * (x+2) as expected, but subst(["["="*","="="+"],[x=1,x=2]); gives x^2+2 ((It would have been nice if minus were nary, so that I could use "="=""...))  These two cases can be worked around by turning simp off temporarily, e.g. subst(["["="*","="="+"],[x=1,x=2]), simp:false; but the workaround for the first case is much clumsier: subst([x=x0,y=x,x0=y],...)  >Comment By: Stavros Macrakis (macrakis) Date: 20021119 14:48 Message: Logged In: YES user_id=588346 Sublis is broken for operators, e.g. sublis(["+"="*"],x+y) And the online documentation (describe) of subst does not mention the parallel substitution issue. I do not think we need both subst([...]) and sublis([...]...). My guess is that sublis was defined before subst was extended to cover the multiple substitution case.  Comment By: Nobody/Anonymous (nobody) Date: 20021116 11:43 Message: Logged In: NO The info tells you to use SUBLIS if you want to do substitution in parallel.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=635627&group_id=4933 