Re: def-simplifier for variable arity functions?

Barton Willis via Maxima-discuss <[email protected]>
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <SN6PR07MB79527E373EB28C09840F56F3B6292@SN6PR07MB7952.namprd07.prod.outlook.com>
No, I was only contemplating changing

(defun simp-set (a yy z)
  (declare (ignore yy))
  ....


     to use the new def-simplifier macro.  That would, I think, change a set object from (($set simp) ...) to ((%set simp) ....).  It makes the code more uniform, but it makes no difference to the user, right?

--Barton
________________________________
From: Stavros Macrakis <[email protected]>
Sent: Sunday, April 26, 2026 12:54 PM
To: Barton Willis <[email protected]>
Cc: Raymond Toy <[email protected]>; [email protected] <[email protected]>
Subject: Re: [Maxima-discuss] def-simplifier for variable arity functions?

Caution: Non-NU Email

I assume that by "convert sets to be noun/verb compliant", you mean to make intersection, union, etc. into simplifying functions? That sounds very valuable! As I suggested in my previous email, I already have some (not quite ready for prime time) code for simplifying, e.g., union(a,a) => a, etc.

It looks like set itself is already a simplifying function:

   simp:false$ set(a,b,a) => set(a,b,a)

There are other nary operators which should be simplifying, namely and/or. Again, my code for that is almost done.

According to its comments, def-simplifier (in defmfun-check.lisp) explicitly does not address the nary case: "the args for the simplifier only supports a fixed set of required arguments". It would be nice to fix that.



On Sun, Apr 26, 2026 at 11:12 AM Barton Willis via Maxima-discuss <[email protected]<mailto:[email protected]>> wrote:
Simplify a set—I was wondering what would happen if we converted sets to be noun/verb compliant. The easiest way to achieve that would be to use def-simplifier.

The only other example of a non-fixed arity function is the humble list, but unlike sets, lists do not have a simplifier.
________________________________
From: Raymond Toy <[email protected]<mailto:[email protected]>>
Sent: Sunday, April 26, 2026 9:29 AM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Subject: Re: [Maxima-discuss] def-simplifier for variable arity functions?

Caution: Non-NU Email


On 4/25/26 4:57 PM, Barton Willis via Maxima-discuss wrote:

Does def-simplifier handle variable arity functions?
Do you have an example?




_______________________________________________
Maxima-discuss mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/maxima-discuss<https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!D2u-7mnlfbSfPuxgCitIo-zzLSOrUw1dDjHpkEASH0fO_bNDf03W1TMS9M6VeCjwgpPn2wo2AyF1qnF_6F4$>


&#8203;
_______________________________________________
Maxima-discuss mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/maxima-discuss<https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!EAGnlEDaGouRc-Td0Dmto0KX0UgmTC7KB5zCMOCJ8YbVicBD2zqKq7pEOB1z2nE9DJwGVfsCBtJl4is$>

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.