Atelier des rouesLab FR
Objects/Documentation

classes23.py

Two five-line proof patterns · classes23.py

Download ↓
"""Order-preserving graph isomorphisms on the five-line witnesses."""
from itertools import permutations
from collections import Counter
import json
from pathlib import Path
from motifs21 import solve


def canonical(masks,order):
    codes=[]
    for a,b in permutations(range(2)):
        seq=[a,b,*order]
        codes.append(tuple(sum(1<<k for k,j in enumerate(seq) if masks[i]>>j&1) for i in seq))
    return min(codes)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.