Lower-order logical independence of boolean functions ...?

Attached is some simple-minded code that explores lower-order order logical independence of the boolean functions of two and three variables.

Eventually, I’m looking to generalize it to n variables. For the moment I’m just trying to understand if there’s extant work or code out there that is applicable.

Thank you,
– Mark