From: Robert D. <rob...@us...> - 2024-08-18 03:02:26
|
- **summary**: user-defined rules apply to expressions with square brackets as parentheses --> user-defined rules apply to expressions with square brackets as well as parentheses --- **[bugs:#4349] user-defined rules apply to expressions with square brackets as well as parentheses** **Status:** open **Group:** None **Labels:** rules tellsimp tellsimpafter defrule defmatch **Created:** Sun Aug 18, 2024 02:06 AM UTC by Robert Dodier **Last Updated:** Sun Aug 18, 2024 02:06 AM UTC **Owner:** nobody Rules defined via `tellsimp`, `tellsimpafter`, `defrule`, and `defmatch` all ignore whether the operator is an ordinary function (with parentheses) or a subscripted operator (with square brackets). Same thing happens with all of them. In every case the generated code is probably just checking whether the expression caar is equal to required one, and not looking at the presence or absence of the ARRAY flag in the expression car. The rule should require the ARRAY flag to be the same as in the pattern for the rule (either ARRAY is present in both pattern and exemplar or absent in both). Here's an example with `tellsimpafter`. Same bug present in `tellsimp`, `defrule`, and `defmatch` as well. ``` (%i4) matchdeclare(aa, integerp); (%o4) done (%i5) tellsimpafter(foo(aa), 1 - aa); (%o5) [foorule1, false] (%i6) foo(10); (%o6) - 9 (%i7) foo[10]; (%o7) - 9 ``` --- Sent from sourceforge.net because max...@li... is subscribed to https://sourceforge.net/p/maxima/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/maxima/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |