rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

substitution into conditional #3528

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 08:05:34 Created by willisbl on 2009-02-01 12:50:02 Original: https://sourceforge.net/p/maxima/bugs/1575


(%i5) subst(x = 0, '(if x < 1 then 5 else log(x))); log(0) has been generated.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 08:05:35 Created by robert_dodier on 2009-03-04 04:57:17 Original: https://sourceforge.net/p/maxima/bugs/1575/#1557


rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 08:05:38 Created by robert_dodier on 2009-03-04 04:57:17 Original: https://sourceforge.net/p/maxima/bugs/1575/#977e


Well, I think subst is just incidental here.

There are actually a couple of interacting problems here. (1) Should branches of conditionals be simplified when the conditional expression is simplified? (2) Should errors be triggered in simplification?

At present branches of conditionals are simplified, and errors are triggered in simplification (e.g. 1/0, log(0), gamma(0)).

Either (1) or (2) or both could go the other way. My own preference is for (1) but not (2), i.e. continue to simplify branches, and prohibit errors in simplification.

Given the current policies (1) and (2), the observed behavior is to be expected; I guess it's a misfeature but I don't know if it's accurate to call it a bug.