A is true for the inputs 01 and 11, while B is true for 11, and C for 00.
This means that (A, B) fulfills the condition since A contains all true inputs of B, therefore B is superfluous and can be deleted.
Either you define the pairs to be directional, (A, B) !
= (B, A), or you remove both A and B when the condition is satisfied. I am looking for a somewhat generic answer assuming unidirectional groups, as I've faced this problem multiple times.
Not much performance concern in building new lists even when fairly large. From what you wrote, it seems that the pairs are not directional, as in (A, B) is equal to (B, A). But then this clashes with the fact that you only remove the second element of the pair when the condition if satisfied.
An important characteristic of such a superfluous logic cube, is that if (B, C) fulfills the condition, and (A, B) as well, then (A, C) also fulfills the condition for sure (both B and C are superfluous).I'm currently using the "indexed outer loop" approach, as doing a logic cube list traversals is cheaper than checking the condition more times than needed, still I'd appreciate some tips on how to avoid the expensive list.get(i). "c.contains(c2)" returns true if (c, c2) fulfills the condition (c2 is superfluous). Assuming I want to be a "good guy" and follow the assurances given by the documentation, in the nested iterator implementation, I am not allowed to call it2.remove() as that will invalidate it1.