(l1: List, l2: List)
| 44 | |
| 45 | # return whether two bag of relations are equivalent |
| 46 | def multiset_eq(l1: List, l2: List) -> bool: |
| 47 | if len(l1) != len(l2): |
| 48 | return False |
| 49 | d = defaultdict(int) |
| 50 | for e in l1: |
| 51 | d[e] = d[e] + 1 |
| 52 | for e in l2: |
| 53 | d[e] = d[e] - 1 |
| 54 | if d[e] < 0: |
| 55 | return False |
| 56 | return True |
| 57 | |
| 58 | |
| 59 | def get_constraint_permutation(tab1_sets_by_columns: List[Set], result2: List[Tuple]): |