Jump to content

Can someone explain what :assoc does in the various functions where it is a keyed parameter?


Recommended Posts

There are 10 functions that have a key parameter :assoc. None of the documentation is particularly clear on what it is or what it does. Most of the functions just list that it is an integer and that it defaults to 12. The only other description that is sometimes added is "row size," but that description is also attached to the :mod key parameter for a number of the functions.

 

I ran the following code to generate a report of how :assoc impacts the row-variants function when run on ordered intervals under various levels of transposition:

 

(pprint-expression
    (loop for x from 1 upto 11
           collect (list
                    (concatenate 'string "Set: (0 " (write-to-string x) ")")
                    (loop for tto in '(i 4 5)
                          collect (list
                                   (concatenate 'string "TTO: " (write-to-string tto))
                                   (loop for transpo from 0 upto 11
                                         collect (list (concatenate 'string "T" (write-to-string transpo))
                                                       (loop for assoc from 12 downto 1
                                                             collect (list (concatenate 'string "assoc" (write-to-string assoc))
                                                                           (row-variant transpo tto (list 0 x) :assoc assoc))))))))))

 

 

I was hoping there would be a discernible pattern, but I couldn't find one. It did not impact the "p" or "r" variants, no matter the transposition, so I removed them from the tto list. For the other three variants, however, it seems to be chaotic.

 

How does that parameter figure into the calculations? When it's at its default of 12, the variants behave as one would expect. But even the inversion of (0 1) gets pretty crazy with smaller values of :assoc (see below). 

 

Thank you,

Jon S

 

("Set: (0 1)"
               (("TTO: i"
                 (("T0"
                   (("assoc12" (0 11))
                    ("assoc11" (0 12))
                    ("assoc10" (0 9))
                    ("assoc9" (0 10))
                    ("assoc8" (0 7))
                    ("assoc7" (0 6))
                    ("assoc6" (0 5))
                    ("assoc5" (0 9))
                    ("assoc4" (0 11))
                    ("assoc3" (0 7))
                    ("assoc2" (0 7))
                    ("assoc1" (0 6))))
                  ("T1"
                   (("assoc12" (11 10))
                    ("assoc11" (12 9))
                    ("assoc10" (9 8))
                    ("assoc9" (10 11))
                    ("assoc8" (7 10))
                    ("assoc7" (8 12))
                    ("assoc6" (11 8))
                    ("assoc5" (6 7))
                    ("assoc4" (3 6))
                    ("assoc3" (8 4))
                    ("assoc2" (9 12))
                    ("assoc1" (7 1))))
                  ("T2"
                   (("assoc12" (10 9))
                    ("assoc11" (9 8))
                    ("assoc10" (8 7))
                    ("assoc9" (11 6))
                    ("assoc8" (10 11))
                    ("assoc7" (12 11))
                    ("assoc6" (4 9))
                    ("assoc5" (3 8))
                    ("assoc4" (10 7))
                    ("assoc3" (4 9))
                    ("assoc2" (4 7))
                    ("assoc1" (4 9))))
                  ("T3"
                   (("assoc12" (9 8))
                    ("assoc11" (8 7))
                    ("assoc10" (7 6))
                    ("assoc9" (12 5))
                    ("assoc8" (5 12))
                    ("assoc7" (11 11))
                    ("assoc6" (9 2))
                    ("assoc5" (2 1))
                    ("assoc4" (1 8))
                    ("assoc3" (6 10))
                    ("assoc2" (1 8))
                    ("assoc1" (6 6))))

 

 

 

Link to comment
Share on other sites

The code I shared was just what I ran to have OM run through a lot of combinations to see if I could find a pattern to how the :assoc parameter affects the output of functions like row-variant. My interest at this point is exploratory. I'm just trying to see if there's a predictable pattern to how changes to :assoc impact the output.

 

Thanks,

Jon

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.

Guest
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