Post Reply 
newRPL - build 1255 released! [updated to 1299]
02-18-2019, 08:21 PM
Post: #381
RE: newRPL - build 1089 released! [update:build 1158]
I did some more thinking on list variants, I thought I'd share. Think of this as a speculative dream, not a list of demands. Smile

First, any list can be converted into "multiset" format. I'm not sure how this should be displayed, but mechanically it's basically two lists: One of elements, one of their multiplicities. ADDing two multiset lists would just add the multiplicities for elements they have in common. A new UNION command would instead take the MAX of the two multiplicities. INTERSECT (or some shorter name) would take their MIN instead. SSUB (set subtraction) would subtract the multiplicities, treating negative numbers as zero. (Naturally, a multiplicity of zero means being removed from the list.)

(I've actually coded a version of set subtraction for regular lists in oldRPL. It has all sorts of unexpected uses!)

There would be a command to split a multiset into two regular lists, one of elements and one of multiplicities. Also one to retrieve the multiplicity of a given element.

(Incidentally, if multisets exist, they would be the natural way for FACTORS to output.)

Sets would then just be multiset lists in which the multiplicities would be constrained to be at most one.

I think multisets are actually more useful than sets, though harder to get working. You can immediately convert a multiset into a set by setting all multiplicities to 1.

The question remains how multisets should respond to operations like '+' and '*'. I'm honestly not sure yet.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL - build 1001 released! - pier4r - 12-16-2017, 08:03 AM
newRPL - on Hp 39gs - Martin Hepperle - 06-05-2019, 06:51 AM
RE: newRPL - build 1001 released! - pier4r - 12-23-2017, 10:16 AM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 09:42 AM
t - Claudio L. - 01-01-2018, 03:06 PM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 03:41 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 04:54 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 06:58 PM
newRPL - brickviking - 10-05-2018, 06:01 AM
RE: newRPL - build 1089 released! [update:build 1158] - The Shadow - 02-18-2019 08:21 PM
How to participate? - erazor - 12-13-2019, 07:12 AM



User(s) browsing this thread: 8 Guest(s)