Atelier des rouesLab FR
Objects/Documentation

transferts11.py

I provide this item to reproduce or inspect AT.R7.

Download ↓
"""Two guarded transports on translation orbits modulo 30 and all rule subsets."""
from fractions import Fraction as F
from itertools import combinations
import json
def run():
    # Property x mod 5 == 0. Each 5-residue has 3 representatives modulo 15,
    # and each 15-residue has 2 modulo 30.
    counts=[sum(x%5==0 for x in range(n)) for n in (5,15,30)]
    assert counts==[1,3,6]
    rules=[('direct',set(), 'goal',30),('base',set(),'small',5),('triple',set(),'uniform3',3),
           ('lift15',{'small','uniform3'},'mid',1),('double',set(),'uniform2',2),('lift30',{'mid','uniform2'},'goal',1)]
    def best(unit,disabled=()):
        options=[]
        for n in range(7):
            for seq in combinations(rules,n):
                if any(row[0] in disabled for row in seq):continue

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.