Jump to content

PCS Sets Sugestion

Recommended Posts

Dear All, 

Happy New Year

I´m back to a lot of work with sets, subsets and supersets and I have an idea/suggestion:


When evaluating this

(pcs-super-sets 7 (pcs '3-1) :forte)

I get this result

(7-1 7-2 7-2b 7-3 7-3b 7-4 7-4b 7-5 7-5b 7-6 7-6b 7-7 7-7b 7-8 7-9 7-9b 7-10 7-10b 7-11 7-11b 7-z12 7-13 7-13b 7-14 7-14b 7-15 7-16 7-16b 7-z17 7-z18 7-z18b 7-19 7-19b 7-20 7-20b 7-21 7-21b 7-22 7-23 7-23b 7-24 7-24b 7-25 7-25b 7-26 7-26b 7-27 7-27b 7-28 7-28b 7-29 7-29b 7-30 7-30b 7-33 7-z36 7-z36b 7-z37 7-z38 7-z38b)

These are all the supersets of cardinality 7 of the 3-1 set.

Would be very nice in this context to have a keyword to invert the result, i.e., actually showing the excluded sets, like all the sets that ARE NOT supersets of the 3-1 set.

Like inverting, like a (pcs-non-super-sets) function. I think that maybe it´s not so difficult, because the algorythm of the function already give the result, the only thing necessary is that the function return exactly the opposite result.





Link to comment
Share on other sites

(let ((out (pcs-cardinal 4 :forte)))
  (loop for i in (pcs-super-sets 4 (pcs '3-1) :forte)
    do (setf out (remove i out))
    finally (return out)))
(let ((rem (pcs-cardinal 7 :forte))
      (super (pcs-super-sets 7 (pcs '3-1) :forte)))
  (loop for i in super
    do (setf rem (remove i rem))
    finally (return rem)))
=> (7-31 7-31b 7-32 7-32b 7-34 7-35)

here it is.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use Privacy Policy