-
Notifications
You must be signed in to change notification settings - Fork 6
/
arcslideda.py
841 lines (798 loc) · 42.7 KB
/
arcslideda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
"""Producing type DA structures for arcslides, using local actions."""
from algebra import TensorGenerator
from dastructure import DAStructure, SimpleDAGenerator
from extendbyid import ExtendedDAStructure, LocalDAStructure
from hdiagram import getArcslideDiagram
from localpmc import LocalIdempotent, LocalStrandAlgebra, PMCSplitting
from pmc import Strands, StrandDiagram
from utility import memorize, subset
from utility import ACTION_LEFT, ACTION_RIGHT, F2
import itertools
class ArcslideDA(ExtendedDAStructure):
"""Responsible for producing a type DA structure for an arcslide, using
local actions.
"""
def __init__(self, slide):
"""Specifies the arcslide to use. slide should be of type Arcslide.
In addition to recording slide, construct the following:
local_pmc1, mapping1 - restriction of starting pmc to location of slide.
outer_pmc1, outer_mapping1 - complement of slide in starting pmc.
local_pmc2, mapping2, outer_pmc2, outer_mapping2
- same, but for ending pmc.
Moreover, find pattern_fun and translator as appropriate for the case at
hand.
"""
self.slide = slide
self.pmc1, self.pmc2 = slide.start_pmc, slide.end_pmc
n = self.pmc1.n
b1, c1, c2 = slide.b1, slide.c1, slide.c2
b1p, c1p, c2p = [slide.to_r[p] for p in (b1, c1, c2)]
# Note intervals (start, end) with start > end are ignored.
# patterns_base specifies one of the four base patterns of arcslides.
# translator gives the mapping between points in the base pattern and
# points in the pattern at hand.
if b1 == c1 + 1: # downward
if c2 == c1 + 2: # short underslide downward
local_cut1, local_cut2 = ([(c1, c2)], [(c1p, c2p)])
patterns_fun = ArcslideDA._short_underslide_down
if c1 == 0:
translator = ([-1, 0, 1, 2, 3], [-1, 0, 1, 2, 3])
elif c2 == n - 1:
translator = ([0, 1, 2, 3, -1], [0, 1, 2, 3, -1])
else:
translator = None
elif c2 > c1: # general underslide downward
local_cut1, local_cut2 = (
[(c1, b1), (c2, c2)], [(c1p, c1p), (b1p, c2p)])
patterns_fun = ArcslideDA._general_underslide_down
if c1 == 0:
translator = ([-1, 0, 1, 2, 3, 4, 5],
[-1, 0, 1, 2, 3, 4, 5])
elif c2 == n - 1:
translator = ([0, 1, 2, 3, 4, 5, -1],
[0, 1, 2, 3, 4, 5, -1])
else:
translator = None
else: # c2 < c1, general overslide downward
local_cut1, local_cut2 = (
[(c2, c2), (c1, b1)], [(b1p, c2p), (c1p, c1p)])
patterns_fun = ArcslideDA._general_underslide_down
if c2 == 0 and b1 == n - 1:
translator = ([2, 3, 4, -1, -1, 0, 1],
[3, 4, -1, -1, 0, 1, 2])
elif c2 == 0:
translator = ([2, 3, 4, 5, -1, 0, 1],
[3, 4, 5, -1, 0, 1, 2])
elif b1 == n - 1:
translator = ([3, 4, 5, -1, 0, 1, 2],
[4, 5, -1, 0, 1, 2, 3])
else:
translator = ([3, 4, 5, 6, 0, 1, 2], [4, 5, 6, 0, 1, 2, 3])
elif b1 == c1 - 1: # upward
if c2 == c1 - 2: # short underslide upward
local_cut1, local_cut2 = ([(c2, c1)], [(c2p, c1p)])
patterns_fun = ArcslideDA._short_underslide_up
if c2 == 0:
translator = ([-1, 0, 1, 2, 3], [-1, 0, 1, 2, 3])
elif c1 == n - 1:
translator = ([0, 1, 2, 3, -1], [0, 1, 2, 3, -1])
else:
translator = None
elif c2 < c1: # general underslide upward
local_cut1, local_cut2 = (
[(c2, c2), (b1, c1)], [(c2p, b1p), (c1p, c1p)])
patterns_fun = ArcslideDA._general_underslide_up
if c2 == 0:
translator = ([-1, 0, 1, 2, 3, 4, 5],
[-1, 0, 1, 2, 3, 4, 5])
elif c1 == n - 1:
translator = ([0, 1, 2, 3, 4, 5, -1],
[0, 1, 2, 3, 4, 5, -1])
else:
translator = None
else: # c2 > c1, general overslide upward
local_cut1, local_cut2 = (
[(b1, c1), (c2, c2)], [(c1p, c1p), (c2p, b1p)])
patterns_fun = ArcslideDA._general_underslide_up
if b1 == 0 and c2 == n - 1:
translator = ([3, 4, -1, -1, 0, 1, 2],
[2, 3, 4, -1, -1, 0, 1])
elif b1 == 0:
translator = ([3, 4, 5, -1, 0, 1, 2],
[2, 3, 4, 5, -1, 0, 1])
elif c2 == n - 1:
translator = ([4, 5, -1, 0, 1, 2, 3],
[3, 4, 5, -1, 0, 1, 2])
else:
translator = ([4, 5, 6, 0, 1, 2, 3], [3, 4, 5, 6, 0, 1, 2])
else:
# All cases are covered. Should not happen.
raise NotImplementedError(
"This slide pattern is not yet implemented.")
self.patterns_fun = patterns_fun
self.translator = translator
# Necesssary to get local DA structure.
self.splitting1 = PMCSplitting(self.pmc1, local_cut1)
self.splitting2 = PMCSplitting(self.pmc2, local_cut2)
self.local_pmc1 = self.splitting1.local_pmc
self.local_pmc2 = self.splitting2.local_pmc
self.mapping1 = self.splitting1.local_mapping
self.mapping2 = self.splitting2.local_mapping
# Required so the left to right transition on the outside can proceed.
assert self.splitting1.outer_pmc == self.splitting2.outer_pmc
# Initiate the ExtendedDAStructure
ExtendedDAStructure.__init__(
self, self.getLocalDAStructure(), self.splitting1, self.splitting2)
# With generators set, add grading. Any generator can serve as base_gen
for gen in self.generators:
base_gen = gen
break
self.registerHDiagram(getArcslideDiagram(self.slide), base_gen)
def getLocalDAStructure(self, seeds_only = False):
"""Returns the local type DA structure associated to slide. If
seeds_only is set to True, get a local DA structure with incomplete
da_action, that can be completed using the autocompleteda module.
"""
# Compute the set of arrow patterns
patterns_raw = self.patterns_fun(seeds_only = seeds_only)
if self.translator is not None:
patterns_raw = ArcslideDA._restrict_local_arrows(
patterns_raw, self.translator[0], self.translator[1])
arrow_patterns = {}
for pattern in patterns_raw:
coeffs_a = []
for i in range(len(pattern)-1):
coeffs_a.append(self.local_pmc2.sd(pattern[i]))
coeffs_a = tuple(coeffs_a)
if coeffs_a not in arrow_patterns:
arrow_patterns[coeffs_a] = []
arrow_patterns[coeffs_a].append(self.local_pmc1.sd(pattern[-1]))
# Now start construction of the local DA structure.
alg1 = LocalStrandAlgebra(F2, self.local_pmc1)
alg2 = LocalStrandAlgebra(F2, self.local_pmc2)
local_dastr = LocalDAStructure(F2, alg1, alg2)
# Mappings between local starting and ending PMC.
slide = self.slide
local_to_r = dict()
for i in range(slide.start_pmc.n):
if i in self.mapping1:
# to_r[i] must be in mapping2
local_to_r[self.mapping1[i]] = self.mapping2[slide.to_r[i]]
local_pair_to_r = dict()
for i in range(self.local_pmc1.n):
if i not in self.local_pmc1.endpoints:
local_pair_to_r[self.local_pmc1.pairid[i]] \
= self.local_pmc2.pairid[local_to_r[i]]
b1, c1 = self.slide.b1, self.slide.c1
local_b1, local_c1 = self.mapping1[b1], self.mapping1[c1]
b_pair1 = self.local_pmc1.pairid[local_b1]
c_pair1 = self.local_pmc1.pairid[local_c1]
# Compute the set of local generators. This includes all
# (l_idem, r_idem) where l_idem = r_idem (under the usual identification
# of pairs), or where l_idem has the c_pair and r_idem has the b_pair.
da_idems = []
num_pair = self.local_pmc1.num_pair
for idem in subset(list(range(num_pair))):
da_idems.append((list(idem), [local_pair_to_r[p] for p in idem]))
for idem in subset([p for p in range(num_pair)
if p != b_pair1 and p != c_pair1]):
da_idems.append((list(idem) + [c_pair1],
[local_pair_to_r[p]
for p in (list(idem) + [b_pair1])]))
for i in range(len(da_idems)):
l_idem, r_idem = da_idems[i]
local_dastr.addGenerator(SimpleDAGenerator(
local_dastr, LocalIdempotent(self.local_pmc1, l_idem),
LocalIdempotent(self.local_pmc2, r_idem), "%d" % i))
mod_gens = local_dastr.getGenerators()
# After having added all generators, create u_map:
local_dastr.auto_u_map()
# Add arrows according to arrow_pattern.
for coeffs_a in list(arrow_patterns.keys()):
if len(coeffs_a) == 1 and coeffs_a[0].isIdempotent():
continue
for coeff_d in arrow_patterns[coeffs_a]:
for x, y in itertools.product(mod_gens, mod_gens):
if DAStructure.idemMatchDA(x, y, coeff_d, coeffs_a):
local_dastr.addDelta(x, y, coeff_d, coeffs_a, 1)
return local_dastr
@staticmethod
def _restrict_local_arrows(patterns, point_map_d, point_map_a):
"""Given a list of patterns (in the format of patterns_raw) for more
general local case, restrict to a more special local case using a
mapping from points in the general local PMC to a special local PMC.
point_map_d and point_map_a specifies the point mappings on the D-side
and the A-side.
This function operates entirely by translation using the given point
map, it does not know about formats for local PMCs or local strand
diagrams.
"""
def translate(lst, mapping):
"""lst consists of either integers or pairs of integers. Translate
according to mapping. If any of the translated value is -1, return
None. Otherwise return the translated list.
"""
result = []
for entry in lst:
if isinstance(entry, int):
result.append(mapping[entry])
if result[-1] == -1:
return None
else: # entry must be a pair
result.append((mapping[entry[0]], mapping[entry[1]]))
if result[-1][0] == -1 or result[-1][1] == -1:
return None
return result
new_patterns = []
for pattern in patterns:
new_pattern = [translate(pattern_d, point_map_a)
for pattern_d in pattern[0:-1]]
new_pattern.append(translate(pattern[-1], point_map_d))
if all([entry != None for entry in new_pattern]):
new_patterns.append(new_pattern)
return new_patterns
# The next series of functions specify the local arrows. The format is as
# follows:
# All but the last element of the tuple is a list to be passed to the sd()
# function of the A-side local PMC, specifying the A-side inputs. The last
# element of the tuple is a list to be passed to the sd() function of the
# D-side local PMC, specifying the D-side output.
@staticmethod
def _short_underslide_down(seeds_only = False):
"""Short underslide going down, in the middle of PMC."""
# Local PMC is 0*-1-2-3-4*, with 1 and 3 paired.
patterns_raw = [
#### Initial patterns
([(1, 2)],),
([], []), ([1], [1]), ([2], [2]), ([2], [1]), ([1, 2], [1, 2]),
([(2, 3)], [1]),
([(1, 2)], [(1, 3)]),
([(1, 3)], [(1, 3)]),
([2, (1, 3)], [2, (1, 3)]),
([(1, 2),(2, 3)], [(1, 2),(2, 3)]),
([(2, 3)], [(1, 2)], [(2, 3)]),
([(2, 3)], [(1, 3)], [(2, 3)]),
#### Seeds for top
([(3, 4)], [(3, 4)]),
([2, (3, 4)], [2, (3, 4)]),
#### Seeds for bottom
([(0, 1)], [(0, 1)]),
([2, (0, 1)], [2, (0, 1)]),
]
if seeds_only:
return patterns_raw
patterns_raw += [
# From seeds for top
([(2, 3), (3, 4)], [(1, 2)], [(1, 2), (2, 4)]),
([2, (3, 4)], [(2, 3)], [(1, 3)], [1, (2, 4)]),
([(2, 3)], [(1, 4)], [(2, 4)]),
([(2, 4)], [(3, 4)]),
([2, (3, 4)], [(2, 3)], [(1, 2)], [1, (2, 4)]),
([(1, 2), (2, 4)], [(1, 2), (2, 4)]),
([2, (1, 4)], [2, (1, 4)]),
([(1, 4)], [(1, 4)]),
# From seeds for bottom
([(2, 3)], [(0, 2), (3, 4)], [(0, 1), (2, 4)]),
([(0, 2)], [(0, 3)]),
([(0, 1), (1, 4)], [(0, 1), (1, 4)]),
([(0, 1), (2, 4)], [(1, 2)], [1, (0, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(1, 2)], [1, (0, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(1, 2)], [(0, 1), (2, 4)]),
([1, (0, 2), (2, 4)], [1, (0, 2), (2, 4)]),
([2, (0, 1), (3, 4)], [2, (1, 3)], [1, 2, (0, 4)]),
([2, (0, 3), (3, 4)], [2, (0, 1), (1, 4)]),
([(3, 4)], [(0, 2)], [1, (0, 4)]),
([(0, 3)], [(0, 3)]),
([(0, 1), (2, 4)], [(1, 2)], [(0, 1), (2, 4)]),
([(0, 2), (3, 4)], [(0, 1), (1, 4)]),
([(2, 3)], [(0, 3), (3, 4)], [(0, 1), (2, 4)]),
([(2, 3), (3, 4)], [(0, 1), (1, 2)], [(0, 2), (2, 3), (3, 4)]),
([(0, 1), (2, 4)], [(1, 3)], [(0, 1), (2, 4)]),
([(0, 2), (2, 4)], [(0, 2), (2, 4)]),
([(2, 3)], [(0, 1), (1, 2)], [2, (3, 4)], [(0, 1), (2, 4)]),
([(2, 3)], [(0, 1), (1, 2)], [(0, 2), (2, 3)]),
([2, (3, 4)], [2, (0, 3)], [1, 2, (0, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(0, 1), (3, 4)]),
([(2, 4)], [(0, 3)], [(0, 1), (2, 4)]),
([(0, 1), (2, 4)], [(0, 1), (3, 4)]),
([(2, 4)], [(0, 2)], [(0, 1), (2, 4)]),
([(0, 3), (3, 4)], [(0, 1), (1, 4)]),
([(0, 2), (2, 3), (3, 4)], [(0, 2), (2, 3), (3, 4)]),
([(2, 4)], [(0, 2)], [1, (0, 4)]),
([(2, 4)], [(0, 3)], [1, (0, 4)]),
([(0, 1), (3, 4)], [(0, 1), (3, 4)]),
([2, (0, 3)], [2, (0, 3)]),
([2, (0, 1), (1, 4)], [2, (0, 1), (1, 4)]),
([(2, 3)], [(0, 1), (1, 2)], [(2, 3), (3, 4)], [(0, 1), (2, 4)]),
([2, (0, 1)], [1, (0, 2)]),
([(2, 3)], [(0, 1), (1, 4)], [(0, 1), (2, 4)]),
([(3, 4)], [(0, 3)], [1, (0, 4)]),
([(0, 4)], [(0, 4)]),
([(0, 1), (1, 2)], [2, (3, 4)], [(0, 1), (1, 4)]),
([(2, 3), (3, 4)], [(1, 2)], [2, (0, 1)], [1, (0, 2), (2, 4)]),
([2, (0, 3), (3, 4)], [1, (0, 2), (2, 4)]),
([2, (0, 1)], [2, (3, 4)], [(0, 1), (3, 4)]),
([2, (0, 4)], [2, (0, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(1, 3)], [(0, 1), (2, 4)]),
([(0, 1), (1, 2)], [(2, 3), (3, 4)], [(0, 1), (1, 4)]),
([(0, 1), (1, 2), (2, 4)], [(0, 1), (1, 2), (2, 4)]),
([1, (2, 4)], [(0, 1), (1, 2)], [1, (0, 2), (2, 4)]),
([(0, 1), (3, 4)], [(1, 2)], [1, (0, 4)]),
([(0, 1), (3, 4)], [(1, 3)], [1, (0, 4)]),
([(0, 1), (2, 4)], [(1, 3)], [1, (0, 4)]),
([2, (0, 1), (3, 4)], [2, (0, 1), (3, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(1, 3)], [1, (0, 4)]),
([(0, 2), (2, 3)], [(0, 2), (2, 3)]),
]
return patterns_raw
@staticmethod
def _general_underslide_down(seeds_only = False):
"""Underslide of length >= 3 going down, in the middle of PMC."""
# Local PMC at left (D-side) is 0*-1-2-3*, 4*-5-6*, with 1 and 5 paired.
# Local PMC at right (A-side) is 0*-1-2*, 3*-4-5-6*, with 1 and 5
# paired.
patterns_raw = [
#### Initial patterns
([(1, 2)],),
([], []), ([1], [1]), ([4], [2]), ([4], [1]), ([1, 4], [1, 2]),
([(4, 5)], [1]),
#### Seeds for top
([(5, 6)], [(5, 6)]),
([4, (5, 6)], [2, (5, 6)]),
#### Seeds for bottom
([(0, 1)], [(0, 1)]),
([4, (0, 1)], [2, (0, 1)]),
#### Seeds for upper middle
([(3, 4)], [(4, 5)]),
#### Seeds for lower middle
([4, (1, 2)], [1, (2, 3)]),
]
if seeds_only:
return patterns_raw
patterns_raw += [
# From seeds for top
([(4, 6)], [(5, 6)]),
# From seeds for bottom
([4, (0, 1)], [(4, 5), (5, 6)], [(0, 1), (5, 6)]),
([4, (0, 1), (5, 6)], [2, (0, 1), (5, 6)]),
([4, (0, 1)], [4, (5, 6)], [(0, 1), (5, 6)]),
([(0, 1), (4, 6)], [(0, 1), (5, 6)]),
([4, (0, 1)], [1, (0, 2)]),
([(0, 1), (5, 6)], [(0, 1), (5, 6)]),
# From seed for upper middle
([(3, 4), (4, 6)], [(1, 2), (4, 6)]),
([(0, 1), (3, 4)], [(0, 2), (4, 5)]),
([(3, 5)], [(4, 5)]),
([(3, 4), (4, 6)], [4, (0, 1)], [1, (0, 2), (4, 6)]),
([(3, 4), (4, 5)], [4, (0, 1), (5, 6)], [1, (0, 2), (4, 6)]),
([(0, 1), (3, 4)], [4, (5, 6)], [(0, 1), (4, 6)]),
([1, (3, 4)], [(4, 5), (5, 6)], [1, (4, 6)]),
([4, (0, 1), (3, 6)], [2, (0, 1), (4, 6)]),
([(0, 1), (3, 4)], [(4, 5), (5, 6)], [(0, 1), (4, 6)]),
([(3, 6)], [(4, 6)]),
([4, (3, 6)], [2, (4, 6)]),
([(3, 4), (5, 6)], [(4, 5), (5, 6)]),
([4, (0, 1), (3, 6)], [1, (0, 2), (4, 6)]),
([(4, 5)], [(3, 5), (5, 6)], [1, (4, 6)]),
([(0, 1), (3, 4), (5, 6)], [(0, 2), (4, 5), (5, 6)]),
([4, (3, 5)], [2, (4, 5)]),
([(0, 1), (3, 6)], [(0, 1), (4, 6)]),
([(4, 6)], [(3, 4)], [1, (4, 6)]),
([1, (3, 4)], [(1, 2), (4, 5)]),
([(4, 6)], [(3, 5)], [1, (4, 6)]),
([1, (3, 4)], [4, (5, 6)], [1, (4, 6)]),
([1, (3, 4)], [4, (0, 1), (5, 6)], [1, (0, 2), (4, 6)]),
([1, (3, 6)], [1, (4, 6)]),
([(3, 5), (5, 6)], [(4, 5), (5, 6)]),
([(0, 1), (3, 4), (4, 6)], [(0, 2), (4, 5), (5, 6)]),
([(3, 4), (4, 5)], [(1, 2), (4, 5)]),
([4, (0, 1)], [(3, 4), (4, 5), (5, 6)], [(0, 2), (4, 5), (5, 6)]),
([(4, 5)], [(3, 4), (5, 6)], [1, (4, 6)]),
([4, (3, 5), (5, 6)], [2, (4, 5), (5, 6)]),
([1, 4, (3, 6)], [1, 2, (4, 6)]),
# From seed for lower middle
([(4, 5)], [(0, 2), (3, 4), (5, 6)], [1, (0, 3), (4, 6)]),
([(4, 6)], [(3, 5)], [(1, 2)], [(2, 3), (4, 6)]),
([(1, 2), (3, 6)], [(1, 3), (4, 6)]),
([(0, 2)], [(0, 3)]),
([(4, 5), (5, 6)], [(1, 2)], [(2, 3), (5, 6)]),
([1, 4, (0, 2), (3, 6)], [1, 2, (0, 3), (4, 6)]),
([(3, 4), (4, 5)], [4, (0, 1), (1, 2)], [4, (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([4, (0, 1), (1, 2)], [4, (5, 6)], [(0, 1), (2, 3), (5, 6)]),
([(0, 1), (1, 2), (3, 4)], [4, (5, 6)], [(0, 1), (1, 3), (4, 6)]),
([(0, 1), (1, 2), (4, 6)], [(0, 1), (2, 3), (5, 6)]),
([1, (0, 2)], [1, (0, 3)]),
([(4, 5), (5, 6)], [(1, 2), (3, 5)], [(2, 3), (4, 5), (5, 6)]),
([(1, 2), (4, 6)], [(3, 4)], [1, (2, 3), (4, 6)]),
([(3, 4), (4, 5)], [4, (1, 2)], [(2, 3), (4, 5)]),
([4, (1, 2), (3, 6)], [2, (1, 3), (4, 6)]),
([(1, 2), (3, 5)], [(1, 3), (4, 5)]),
([(1, 2), (3, 4), (4, 6)], [(1, 2), (2, 3), (4, 6)]),
([4, (0, 1), (1, 2)], [(4, 5), (5, 6)], [(0, 1), (2, 3), (5, 6)]),
([4, (1, 2), (3, 5)], [2, (1, 3), (4, 5)]),
([(4, 6)], [(0, 2), (3, 4)], [1, (0, 3), (4, 6)]),
([1, (3, 4)], [(0, 2), (4, 5), (5, 6)], [1, (0, 3), (4, 6)]),
([(4, 5)], [(1, 2), (3, 5)], [(2, 3), (4, 5)]),
([(0, 2), (3, 6)], [(0, 3), (4, 6)]),
([(1, 2), (4, 6)], [(3, 5)], [1, (2, 3), (4, 6)]),
([4, (0, 1), (1, 2)], [(3, 4), (4, 5), (5, 6)], [(0, 2), (2, 3), (4, 5), (5, 6)]),
([(0, 2), (4, 5)], [(3, 5), (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(1, 2), (3, 4), (4, 5)], [(1, 2), (2, 3), (4, 5)]),
([(1, 2), (4, 5)], [1, (2, 3)]),
([(0, 2), (3, 4), (5, 6)], [(0, 3), (4, 5), (5, 6)]),
([(4, 5)], [(0, 1), (1, 2), (3, 4)], [4, (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (4, 5)], [(3, 5), (5, 6)], [1, (0, 3), (4, 6)]),
([(3, 4), (4, 5)], [(4, 5), (5, 6)], [(1, 2)], [(2, 3), (4, 6)]),
([(0, 2), (4, 6)], [(0, 3), (5, 6)]),
([1, (3, 4), (4, 6)], [(1, 2), (4, 5)], [1, (2, 3), (4, 6)]),
([(3, 4), (4, 5)], [(1, 2), (4, 6)], [(2, 3), (4, 6)]),
([4, (0, 1)], [(1, 2), (3, 4), (4, 6)], [(0, 1), (2, 3), (4, 6)]),
([4, (0, 1), (1, 2)], [2, (0, 1), (1, 3)]),
([(0, 1), (1, 2), (3, 4), (4, 6)], [(0, 2), (2, 3), (4, 5), (5, 6)]),
([(0, 1), (1, 2)], [(0, 1), (1, 3)]),
([1, (4, 6)], [(1, 2), (3, 5)], [1, (2, 3), (4, 6)]),
([1, (4, 6)], [(1, 2), (3, 4)], [1, (2, 3), (4, 6)]),
([(0, 2), (4, 5)], [(3, 4), (5, 6)], [1, (0, 3), (4, 6)]),
([(4, 5)], [(0, 1), (1, 2), (3, 6)], [(0, 1), (2, 3), (4, 6)]),
([4, (0, 2)], [(0, 1), (2, 3)]),
([(0, 1), (4, 6)], [(1, 2), (3, 5)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (3, 5)], [(0, 3), (4, 5)]),
([(0, 1), (3, 4), (4, 6)], [(1, 2), (4, 5)], [(0, 1), (2, 3), (4, 6)]),
([1, (0, 2), (3, 4)], [(4, 5), (5, 6)], [1, (0, 3), (4, 6)]),
([(4, 5)], [(3, 5), (5, 6)], [(0, 1), (1, 2)], [(0, 1), (2, 3), (4, 6)]),
([1, 4, (0, 2)], [1, 2, (0, 3)]),
([(3, 4), (4, 6)], [(4, 5)], [(0, 1), (1, 2)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (4, 6)], [(3, 5)], [(0, 1), (2, 3), (4, 6)]),
([4, (0, 2), (5, 6)], [(0, 1), (2, 3), (5, 6)]),
([4, (0, 2)], [1, (0, 3)]),
([(3, 4), (4, 5)], [(0, 2), (4, 5), (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (3, 4), (4, 6)], [(0, 1), (1, 3), (4, 6)]),
([(0, 2), (3, 4), (4, 5)], [4, (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(4, 5)], [(0, 1), (1, 2), (3, 4)], [(0, 2), (2, 3), (4, 5)]),
([4, (0, 1), (1, 2)], [1, (0, 2), (2, 3)]),
([(1, 2), (3, 4)], [(1, 3), (4, 5)]),
([4, (0, 2), (3, 5)], [2, (0, 3), (4, 5)]),
([(3, 4), (4, 5)], [(1, 2), (4, 5)], [(2, 3), (4, 5)]),
([(3, 4), (4, 6)], [(4, 5)], [(1, 2)], [(2, 3), (4, 6)]),
([(0, 2), (4, 5)], [1, (0, 3)]),
([(4, 5), (5, 6)], [(1, 2), (3, 4)], [(2, 3), (4, 5), (5, 6)]),
([(0, 2), (4, 5), (5, 6)], [(0, 1), (2, 3), (5, 6)]),
([(4, 5)], [(3, 5), (5, 6)], [(1, 2)], [(2, 3), (4, 6)]),
([(0, 2), (4, 5)], [(0, 1), (2, 3)]),
([(4, 6)], [(0, 2), (3, 5)], [(0, 1), (2, 3), (4, 6)]),
([(3, 4), (4, 6)], [(0, 2), (4, 5)], [(0, 1), (2, 3), (4, 6)]),
([1, (3, 4), (4, 6)], [4, (1, 2)], [1, (2, 3), (4, 6)]),
([(3, 4), (4, 5)], [(4, 5), (5, 6)], [(0, 1), (1, 2)], [(0, 1), (2, 3), (4, 6)]),
([(3, 4), (4, 5)], [(0, 1), (1, 2), (4, 6)], [(0, 1), (2, 3), (4, 6)]),
([(3, 4), (4, 5)], [4, (0, 1), (1, 2)], [(0, 2), (2, 3), (4, 5)]),
([(0, 1), (3, 4), (4, 6)], [4, (1, 2)], [1, (0, 3), (4, 6)]),
([(1, 2), (3, 4), (4, 6)], [4, (0, 1)], [1, (0, 2), (2, 3), (4, 6)]),
([(4, 5)], [(1, 2)], [(2, 3)]),
([1, (0, 2), (3, 6)], [1, (0, 3), (4, 6)]),
([4, (1, 2)], [2, (1, 3)]),
([(3, 4), (4, 5)], [4, (0, 1), (1, 2)], [(4, 5), (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (3, 4), (4, 5)], [(0, 2), (2, 3), (4, 5)]),
([(4, 5)], [(0, 1), (1, 2), (3, 4)], [(4, 5), (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([4, (0, 1), (1, 2), (3, 6)], [2, (0, 1), (1, 3), (4, 6)]),
([(3, 4), (4, 5), (5, 6)], [4, (1, 2)], [(2, 3), (4, 5), (5, 6)]),
([(4, 6)], [(0, 2), (3, 5)], [1, (0, 3), (4, 6)]),
([4, (0, 1), (1, 2), (3, 6)], [1, (0, 2), (2, 3), (4, 6)]),
([(1, 2), (4, 5)], [(3, 4), (5, 6)], [1, (2, 3), (4, 6)]),
([(4, 5)], [(1, 2), (3, 6)], [(2, 3), (4, 6)]),
([4, (0, 2), (5, 6)], [2, (0, 3), (5, 6)]),
([4, (0, 2)], [2, (0, 3)]),
([(0, 2), (5, 6)], [(0, 3), (5, 6)]),
([(1, 2), (4, 5)], [(3, 5), (5, 6)], [1, (2, 3), (4, 6)]),
([(0, 1), (4, 6)], [(1, 2), (3, 4)], [1, (0, 3), (4, 6)]),
([4, (0, 2), (3, 5), (5, 6)], [2, (0, 3), (4, 5), (5, 6)]),
([(0, 1), (4, 6)], [(1, 2), (3, 5)], [1, (0, 3), (4, 6)]),
([4, (0, 2), (3, 6)], [2, (0, 3), (4, 6)]),
([1, (0, 2), (3, 4)], [4, (5, 6)], [1, (0, 3), (4, 6)]),
([(0, 1), (3, 4), (4, 6)], [(1, 2), (4, 5)], [1, (0, 3), (4, 6)]),
([(0, 2), (3, 4)], [(0, 3), (4, 5)]),
([(0, 1), (1, 2), (3, 6)], [(0, 1), (1, 3), (4, 6)]),
([(0, 2), (3, 4), (4, 5), (5, 6)], [(0, 2), (2, 3), (4, 5), (5, 6)]),
([(4, 5)], [(1, 2), (3, 4)], [(2, 3), (4, 5)]),
([(1, 2)], [(1, 3)]),
([(0, 2), (3, 5), (5, 6)], [(0, 3), (4, 5), (5, 6)]),
([(1, 2), (3, 4), (4, 5)], [4, (0, 1), (5, 6)], [1, (0, 2), (2, 3), (4, 6)]),
([(3, 4), (4, 5), (5, 6)], [4, (0, 1), (1, 2)], [(0, 2), (2, 3), (4, 5), (5, 6)]),
([1, (3, 4)], [4, (0, 2), (5, 6)], [1, (0, 3), (4, 6)]),
([(0, 2), (3, 4), (4, 6)], [(4, 5)], [(0, 1), (2, 3), (4, 6)]),
([(4, 5)], [(0, 1), (1, 2)], [(0, 1), (2, 3)]),
([(4, 5)], [(0, 2), (3, 5), (5, 6)], [1, (0, 3), (4, 6)]),
([4, (0, 2)], [(3, 4), (4, 6)], [(0, 1), (2, 3), (4, 6)]),
([(4, 5), (5, 6)], [(0, 1), (1, 2)], [(0, 1), (2, 3), (5, 6)]),
([(4, 5)], [(0, 2), (3, 5), (5, 6)], [(0, 1), (2, 3), (4, 6)]),
([(0, 2), (4, 6)], [(3, 5)], [1, (0, 3), (4, 6)]),
([(1, 2), (4, 6)], [(2, 3), (5, 6)]),
([(0, 1), (1, 2), (3, 4)], [(4, 5), (5, 6)], [(0, 1), (1, 3), (4, 6)]),
([(0, 2), (4, 6)], [(3, 4)], [1, (0, 3), (4, 6)]),
([(4, 6)], [(3, 5)], [(0, 1), (1, 2)], [(0, 1), (2, 3), (4, 6)]),
([(3, 4), (4, 5), (5, 6)], [(1, 2), (4, 5)], [(2, 3), (4, 5), (5, 6)]),
([4, (0, 2), (3, 6)], [(0, 1), (2, 3), (4, 6)]),
([(4, 5), (5, 6)], [(0, 1), (1, 2), (3, 4)], [(0, 2), (2, 3), (4, 5), (5, 6)]),
]
return patterns_raw
@staticmethod
def _short_underslide_up(seeds_only = False):
"""Short underslide going up, in the middle of PMC."""
# Local PMC is 0*-1-2-3-4*, with 1 and 3 paired.
patterns_raw = [
#### Initial patterns
([(2, 3)],),
([], []), ([1], [1]), ([2], [2]), ([2], [1]), ([1, 2], [1, 2]),
([(1, 2)], [1]),
([(2, 3)], [(1, 3)]),
([(1, 3)], [(1, 3)]),
([2, (1, 3)], [2, (1, 3)]),
([(1, 2),(2, 3)], [(1, 2),(2, 3)]),
([(2, 3)], [(1, 2)], [(1, 2)]),
([(1, 3)], [(1, 2)], [(1, 2)]),
#### Seeds for top
([(3, 4)], [(3, 4)]),
([2, (3, 4)], [2, (3, 4)]),
#### Seeds for bottom
([(0, 1)], [(0, 1)]),
([2, (0, 1)], [2, (0, 1)]),
]
if seeds_only:
return patterns_raw
patterns_raw += [
# From seeds for top
([(2, 3), (3, 4)], [(1, 2)], [(1, 2), (2, 4)]),
([(2, 4)], [(1, 4)]),
([(1, 4)], [(1, 4)]),
([2, (1, 4)], [2, (1, 4)]),
([2, (3, 4)], [1, (2, 4)]),
([(1, 2), (2, 4)], [(1, 2), (2, 4)]),
# From seeds for bottom
([(1, 3)], [1, (0, 2)], [1, (0, 2)]),
([(1, 3)], [(0, 2), (3, 4)], [1, (0, 4)]),
([(2, 3)], [(0, 2), (3, 4)], [(0, 2), (3, 4)]),
([(0, 2), (3, 4)], [(0, 1), (3, 4)]),
([(1, 4)], [(0, 1)], [1, (0, 4)]),
([(0, 1), (1, 2), (2, 4)], [(0, 1), (1, 2), (2, 4)]),
([(0, 1), (1, 2)], [(2, 3), (3, 4)], [(1, 2)], [(0, 2), (3, 4)]),
([(1, 3)], [(0, 2), (3, 4)], [(0, 2), (3, 4)]),
([(0, 2)], [(0, 1)]),
([1, (0, 2), (2, 4)], [1, (0, 2), (2, 4)]),
([(0, 1), (1, 4)], [(1, 2)], [(0, 2), (3, 4)]),
([(0, 3)], [(0, 3)]),
([2, (0, 1), (1, 4)], [1, (0, 2), (2, 4)]),
([2, (0, 1), (1, 4)], [2, (0, 3), (3, 4)]),
([(0, 2), (2, 3), (3, 4)], [(0, 2), (2, 3), (3, 4)]),
([(0, 1), (2, 4)], [(1, 2)], [(0, 2), (3, 4)]),
([(2, 3), (3, 4)], [1, (0, 2)], [1, (0, 2), (2, 4)]),
([(0, 1), (2, 4)], [(0, 3), (3, 4)]),
([2, (1, 3)], [2, (0, 1), (3, 4)], [1, 2, (0, 4)]),
([(2, 3)], [(0, 1), (1, 2)], [(0, 1), (1, 2)]),
([(0, 2), (2, 4)], [(0, 2), (2, 4)]),
([(2, 4)], [(0, 1)], [1, (0, 4)]),
([(0, 1), (1, 4)], [(0, 3), (3, 4)]),
([(2, 4)], [(0, 2)], [1, (0, 4)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(1, 2)], [(0, 2), (3, 4)]),
([(1, 3)], [(0, 1), (3, 4)], [1, (0, 4)]),
([(2, 3)], [(0, 1), (3, 4)], [1, (0, 4)]),
([(0, 1), (1, 2)], [(2, 3), (3, 4)], [(0, 3), (3, 4)]),
([2, (0, 3), (3, 4)], [2, (0, 3), (3, 4)]),
([(1, 4)], [(0, 2)], [(0, 2), (3, 4)]),
([(0, 1), (1, 2)], [2, (3, 4)], [(0, 1), (3, 4)]),
([(2, 3), (3, 4)], [(0, 1), (1, 2)], [(0, 1), (1, 2), (2, 4)]),
([(0, 1), (3, 4)], [(0, 1), (3, 4)]),
([2, (0, 3)], [2, (0, 3)]),
([(0, 3), (3, 4)], [(1, 2)], [(0, 2), (3, 4)]),
([(1, 4)], [(0, 2)], [1, (0, 4)]),
([(0, 4)], [(0, 4)]),
([2, (1, 4)], [2, (0, 1)], [1, 2, (0, 4)]),
([(2, 3)], [1, (0, 2)], [1, (0, 2)]),
([2, (0, 4)], [2, (0, 4)]),
([2, (0, 1)], [2, (3, 4)], [(0, 1), (3, 4)]),
([(2, 3)], [(0, 2), (3, 4)], [1, (0, 4)]),
([(0, 3)], [(1, 2)], [(0, 2)]),
([2, (0, 1)], [(2, 3), (3, 4)], [(0, 3), (3, 4)]),
([(1, 3)], [(0, 1), (1, 2)], [(0, 1), (1, 2)]),
([(2, 4)], [(0, 2)], [(0, 2), (3, 4)]),
([(0, 3), (3, 4)], [(0, 3), (3, 4)]),
([2, (0, 1), (3, 4)], [2, (0, 1), (3, 4)]),
([(0, 2), (2, 3)], [(0, 2), (2, 3)]),
]
return patterns_raw
@staticmethod
def _general_underslide_up(seeds_only = False):
"""Underslide of length >= 3 going up, in the middle of PMC."""
# Local PMC at left (D-side) is 0*-1-2*, 3*-4-5-6*, with 1 and 5 paired.
# Local PMC at right (A-side) is 0*-1-2-3*, 4*-5-6*, with 1 and 5
# paired.
patterns_raw = [
#### Initial patterns
([(4, 5)],),
([], []), ([1], [1]), ([2], [4]), ([2], [1]), ([1, 2], [1, 4]),
([(1, 2)], [1]),
#### Seeds for top
([(5, 6)], [(5, 6)]),
([2, (5, 6)], [4, (5, 6)]),
#### Seeds for bottom
([(0, 1)], [(0, 1)]),
([2, (0, 1)], [4, (0, 1)]),
#### Seed for upper middle
([2, (4, 5)], [1, (3, 4)]),
#### Seed for lower middle
([(2, 3)], [(1, 2)]),
]
if seeds_only:
return patterns_raw
patterns_raw += [
# From seeds for top
([2, (5, 6)], [1, (4, 6)]),
# From seeds for bottom
([2, (0, 1)], [2, (5, 6)], [(0, 1), (5, 6)]),
([(0, 2), (5, 6)], [(0, 1), (5, 6)]),
([2, (0, 1), (5, 6)], [4, (0, 1), (5, 6)]),
([(0, 2)], [(0, 1)]),
([(0, 1), (1, 2)], [2, (5, 6)], [(0, 1), (5, 6)]),
([(0, 1), (5, 6)], [(0, 1), (5, 6)]),
# From seed for upper middle
([2, (4, 5)], [4, (3, 5)]),
([1, (4, 6)], [1, (3, 6)]),
([(0, 2), (4, 5), (5, 6)], [(0, 1), (3, 4), (5, 6)]),
([(4, 5)], [(3, 5)]),
([(0, 1), (1, 2), (4, 6)], [(0, 1), (3, 4), (5, 6)]),
([2, (4, 6)], [4, (3, 6)]),
([2, (0, 1)], [2, (4, 5), (5, 6)], [(0, 1), (3, 4), (5, 6)]),
([(4, 5), (5, 6)], [(1, 2)], [(3, 4), (5, 6)]),
([(1, 2), (4, 6)], [(3, 4), (5, 6)]),
([(0, 1), (4, 6)], [(0, 1), (3, 6)]),
([1, 2, (4, 6)], [1, 4, (3, 6)]),
([(4, 5)], [(1, 2)], [(3, 4)]),
([(1, 2), (4, 5)], [1, (3, 4)]),
([2, (0, 1), (4, 6)], [4, (0, 1), (3, 6)]),
([2, (4, 6)], [1, (3, 6)]),
([(0, 1), (1, 2)], [2, (4, 5), (5, 6)], [(0, 1), (3, 4), (5, 6)]),
([(0, 2), (4, 5)], [(0, 1), (3, 4)]),
([2, (4, 6)], [(3, 4), (5, 6)]),
([(4, 5), (5, 6)], [(3, 5), (5, 6)]),
([(4, 6)], [(3, 6)]),
([2, (4, 5), (5, 6)], [1, (3, 4), (4, 6)]),
([(1, 2), (4, 6)], [1, (3, 6)]),
([2, (0, 1), (4, 6)], [(0, 1), (3, 4), (5, 6)]),
([2, (4, 5), (5, 6)], [4, (3, 5), (5, 6)]),
([(0, 2), (4, 6)], [(0, 1), (3, 6)]),
([(4, 5)], [(0, 1), (1, 2)], [(0, 1), (3, 4)]),
([(4, 5), (5, 6)], [(0, 1), (1, 2)], [(0, 1), (3, 4), (5, 6)]),
# From seed for lower middle
([2, (0, 3), (4, 5), (5, 6)], [4, (0, 2), (3, 5), (5, 6)]),
([2, (0, 3), (5, 6)], [4, (0, 2), (5, 6)]),
([(2, 3), (5, 6)], [(0, 1)], [1, (0, 2), (4, 6)]),
([(1, 3), (4, 5)], [(1, 2)], [(1, 2), (3, 4)]),
([(0, 2), (4, 5), (5, 6)], [(1, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3)], [(0, 2), (4, 5)], [1, (0, 2), (3, 4)]),
([2, (4, 5)], [(0, 1), (1, 2), (2, 3)], [(0, 1), (1, 2), (3, 4)]),
([2, (1, 3)], [2, (0, 1), (4, 6)], [1, 4, (0, 2), (3, 6)]),
([(0, 3), (4, 5)], [(0, 2), (3, 5)]),
([(0, 2), (2, 3)], [2, (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3), (4, 5)], [(0, 2), (5, 6)], [(0, 2), (3, 4), (5, 6)]),
([(2, 3), (4, 5)], [(0, 1), (1, 2)], [(0, 1), (1, 2), (3, 4)]),
([(0, 1), (1, 2), (2, 3)], [2, (5, 6)], [(0, 1), (1, 2), (4, 6)]),
([(2, 3), (4, 5)], [(0, 2), (5, 6)], [1, (0, 2), (3, 6)]),
([2, (1, 3), (4, 6)], [2, (0, 1)], [1, 4, (0, 2), (3, 6)]),
([(0, 1), (1, 2), (4, 6)], [(1, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([1, 2, (0, 3)], [1, 4, (0, 2)]),
([(0, 1), (1, 3), (4, 6)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([2, (0, 3), (4, 6)], [4, (0, 2), (3, 6)]),
([(4, 5)], [(1, 3)], [(0, 2)], [(0, 2), (3, 4)]),
([(2, 3)], [(0, 2), (4, 6)], [1, (0, 2), (3, 6)]),
([(0, 1), (2, 3)], [(5, 6)], [(0, 2), (5, 6)]),
([(0, 1), (1, 2)], [2, (4, 5), (5, 6)], [(1, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([(0, 1), (1, 3)], [(1, 2), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(2, 3)], [(0, 1)], [1, (0, 2)]),
([2, (0, 1), (1, 3), (4, 6)], [1, (0, 2), (3, 4), (4, 6)]),
([(1, 3), (4, 6)], [(1, 2), (3, 6)]),
([(1, 2), (4, 6)], [(0, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3), (4, 5)], [(0, 1), (1, 2)], [(0, 1), (1, 2), (3, 4)]),
([1, (4, 6)], [(0, 1), (1, 3)], [1, (0, 2), (3, 6)]),
([(1, 2), (2, 3), (4, 6)], [(1, 2), (3, 4), (4, 6)]),
([2, (0, 1)], [(2, 3), (4, 5), (5, 6)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([2, (0, 3), (4, 5)], [4, (0, 2), (3, 5)]),
([2, (0, 1), (1, 3)], [1, 2, (4, 6)], [1, 4, (0, 2), (3, 6)]),
([(1, 2)], [(0, 2), (2, 3), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(4, 5)], [(0, 1), (1, 2)], [(1, 2), (2, 3)], [(0, 2), (3, 4)]),
([2, (1, 3), (4, 5)], [2, (0, 1), (5, 6)], [1, 4, (0, 2), (3, 6)]),
([(4, 5), (5, 6)], [(0, 1), (1, 3)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([2, (1, 3)], [4, (1, 2)]),
([1, (2, 3)], [(1, 2), (4, 5)]),
([2, (4, 5)], [(1, 2), (2, 3)], [(1, 2), (3, 4)]),
([(0, 2), (2, 3), (4, 5), (5, 6)], [(0, 1), (1, 2), (3, 4), (4, 6)]),
([(2, 3)], [(0, 2)], [1, (0, 2)]),
([(0, 2), (4, 5)], [(1, 2), (2, 3)], [(0, 2), (3, 4)]),
([(2, 3)], [(0, 1), (4, 6)], [1, (0, 2), (3, 6)]),
([1, (0, 2), (2, 3)], [2, (5, 6)], [1, (0, 2), (4, 6)]),
([(4, 5), (5, 6)], [(1, 2)], [(0, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([2, (4, 5), (5, 6)], [(1, 2), (2, 3)], [(1, 2), (3, 4), (4, 6)]),
([(1, 2), (4, 5)], [1, (0, 2), (2, 3)], [1, (0, 2), (3, 4)]),
([(0, 1), (1, 3)], [(1, 2), (4, 6)], [1, (0, 2), (3, 6)]),
([(0, 1), (1, 3)], [(1, 2), (4, 5)], [1, (0, 2), (3, 4)]),
([(0, 1), (2, 3)], [(4, 5), (5, 6)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3), (4, 5)], [(0, 1), (5, 6)], [1, (0, 2), (3, 6)]),
([(2, 3), (4, 5), (5, 6)], [(0, 1), (1, 2)], [(0, 1), (1, 2), (3, 4), (4, 6)]),
([(4, 5)], [(1, 2)], [(0, 2), (2, 3)], [(0, 2), (3, 4)]),
([(1, 3), (4, 6)], [(0, 2)], [(0, 2), (3, 4), (5, 6)]),
([(0, 2), (2, 3)], [(0, 2), (4, 5)]),
([1, (0, 3)], [1, (0, 2)]),
([(4, 5), (5, 6)], [(1, 3)], [(0, 2)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3), (4, 5)], [(1, 2), (3, 5)]),
([(2, 3), (5, 6)], [(1, 2), (4, 6)]),
([2, (1, 3), (4, 5)], [4, (1, 2), (3, 5)]),
([2, (0, 1)], [2, (4, 5), (5, 6)], [(1, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([(2, 3), (4, 5)], [(0, 1), (5, 6)], [1, (0, 2), (3, 6)]),
([(0, 1), (2, 3)], [(1, 2), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(2, 3), (4, 6)], [(0, 1)], [1, (0, 2), (3, 6)]),
([(0, 3), (4, 5), (5, 6)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([2, (0, 3), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(1, 2), (4, 5)], [(0, 2), (2, 3), (5, 6)], [(0, 2), (3, 4), (5, 6)]),
([2, (4, 5), (5, 6)], [(0, 1), (1, 2), (2, 3)], [(0, 1), (1, 2), (3, 4), (4, 6)]),
([(0, 1), (2, 3)], [(0, 2), (4, 5)]),
([(2, 3), (4, 6)], [(0, 2)], [1, (0, 2), (3, 6)]),
([(2, 3), (4, 5)], [(1, 2)], [(1, 2), (3, 4)]),
([(0, 1), (1, 2)], [(2, 3), (4, 5), (5, 6)], [(0, 2), (3, 5), (5, 6)]),
([(0, 1), (1, 3)], [1, (4, 6)], [1, (0, 2), (3, 6)]),
([(0, 1), (2, 3), (4, 6)], [(0, 2), (3, 5), (5, 6)]),
([2, (1, 3), (4, 6)], [4, (1, 2), (3, 6)]),
([(1, 3)], [(1, 2)]),
([2, (0, 3)], [4, (0, 2)]),
([1, (2, 3)], [(0, 1), (5, 6)], [1, (0, 2), (4, 6)]),
([2, (0, 1)], [(1, 2), (2, 3), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(0, 2), (2, 3), (5, 6)], [2, (4, 5)], [1, (0, 2), (3, 4), (4, 6)]),
([(0, 1), (1, 2), (2, 3)], [2, (4, 5), (5, 6)], [(0, 1), (1, 2), (3, 4), (4, 6)]),
([(0, 1), (1, 2)], [(2, 3), (5, 6)], [(0, 2), (5, 6)]),
([(2, 3), (5, 6)], [(0, 2)], [1, (0, 2), (4, 6)]),
([(4, 5)], [(0, 1), (1, 3)], [(1, 2)], [(0, 2), (3, 4)]),
([(0, 3), (4, 5), (5, 6)], [(0, 2), (3, 5), (5, 6)]),
([2, (0, 1), (5, 6)], [(1, 2), (2, 3), (4, 5)], [1, (0, 2), (3, 4), (4, 6)]),
([(0, 3), (5, 6)], [(0, 2), (5, 6)]),
([(0, 1), (2, 3), (5, 6)], [(0, 2), (4, 5), (5, 6)]),
([1, 2, (4, 6)], [2, (0, 1), (1, 3)], [1, 4, (0, 2), (3, 6)]),
([(0, 2), (2, 3), (4, 6)], [(0, 2), (3, 5), (5, 6)]),
([(1, 3), (4, 6)], [(0, 2)], [1, (0, 2), (3, 6)]),
([(1, 3), (4, 5)], [(0, 2), (5, 6)], [1, (0, 2), (3, 6)]),
([(0, 2), (2, 3), (5, 6)], [(0, 2), (4, 5), (5, 6)]),
([(1, 2), (4, 5)], [(0, 1), (1, 2), (2, 3)], [(0, 1), (1, 2), (3, 4)]),
([2, (4, 5)], [1, (0, 2), (2, 3)], [1, (0, 2), (3, 4)]),
([(1, 3)], [(0, 2), (4, 6)], [(0, 2), (3, 4), (5, 6)]),
([(1, 3)], [(0, 2)], [1, (0, 2)]),
([(2, 3), (4, 5), (5, 6)], [(1, 2)], [(1, 2), (3, 4), (4, 6)]),
([(0, 1), (2, 3), (5, 6)], [(1, 2), (4, 5)], [1, (0, 2), (3, 4), (4, 6)]),
([(0, 1), (1, 3)], [(0, 1), (1, 2)]),
([2, (0, 1), (1, 3), (4, 6)], [4, (0, 2), (3, 5), (5, 6)]),
([(0, 2), (2, 3), (4, 5)], [2, (5, 6)], [(0, 2), (3, 4), (5, 6)]),
([2, (0, 3), (4, 5), (5, 6)], [1, (0, 2), (3, 4), (4, 6)]),
([2, (0, 1)], [(2, 3), (5, 6)], [(0, 2), (5, 6)]),
([(0, 1), (2, 3)], [(4, 5), (5, 6)], [(0, 2), (3, 5), (5, 6)]),
([(0, 2), (2, 3), (4, 5)], [(0, 2), (3, 4), (4, 5)]),
([(1, 3)], [(0, 2), (4, 6)], [1, (0, 2), (3, 6)]),
([(1, 3), (4, 6)], [(0, 1)], [1, (0, 2), (3, 6)]),
([(0, 3), (4, 5)], [(1, 2)], [(0, 2), (3, 4)]),
([(2, 3)], [(0, 2), (4, 5)], [1, (0, 2), (3, 4)]),
([(0, 3)], [(0, 2)]),
([(0, 3), (4, 6)], [(0, 2), (3, 6)]),
([(0, 1), (1, 2), (2, 3), (4, 6)], [(0, 1), (1, 2), (3, 4), (4, 6)]),
([(2, 3), (4, 5)], [(1, 2), (3, 5)]),
([(1, 2), (2, 3), (4, 5)], [(1, 2), (3, 4), (4, 5)]),
([(0, 1), (1, 3)], [(1, 2)], [1, (0, 2)]),
([(0, 1), (1, 2)], [(2, 3), (4, 5), (5, 6)], [(1, 2)], [(0, 2), (3, 4), (5, 6)]),
([(0, 1), (1, 3), (4, 6)], [(0, 2), (3, 5), (5, 6)]),
([(1, 2)], [(0, 1), (2, 3)], [1, (0, 2)]),
([(1, 3)], [(0, 1), (4, 6)], [1, (0, 2), (3, 6)]),
([(2, 3), (4, 5)], [1, (0, 2)], [1, (0, 2), (3, 4)]),
([(2, 3), (4, 6)], [(1, 2), (3, 6)]),
([2, (0, 1), (1, 3)], [4, (0, 1), (1, 2)]),
([(4, 5), (5, 6)], [(0, 1), (1, 2)], [(1, 2), (2, 3)], [(0, 2), (3, 4), (5, 6)]),
([2, (0, 1)], [(2, 3), (4, 5), (5, 6)], [(0, 2), (3, 5), (5, 6)]),
([2, (5, 6)], [(0, 2), (2, 3), (4, 5)], [1, (0, 2), (3, 4), (4, 6)]),
([(1, 2), (4, 5)], [(1, 2), (2, 3)], [(1, 2), (3, 4)]),
([(0, 1), (1, 2)], [1, (2, 3)], [1, (0, 2)]),
([(1, 3), (4, 5)], [1, (0, 2)], [1, (0, 2), (3, 4)]),
([1, (2, 3)], [(0, 2), (5, 6)], [1, (0, 2), (4, 6)]),
([(1, 2), (2, 3)], [(1, 2), (4, 5)]),
]
return patterns_raw