← 60c27b9638fb · 60d5b73ff222 →

60c56114260f

Build the pairwise dihedral-equivalence matrix of sorted objects.

dihedral symmetryrelation matricesshape normalization

Generated by the released generator before publication; every output was computed by its Racket reference rule. White outlines mark the cells the rule changed. Lesson check:

refuted: a demonstration contradicts the rival. survived_all: it fits every demonstration and also gives the intended answer, so it cannot mislead here. ambiguous: it fits every demonstration but answers the query differently. Names are as declared by the generator; a declared shortcut is not guaranteed to fit the original pairs (see the paper’s Limitations).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define objs (sort (objects g 0)
                       (lambda (a b)
                         (if (= (obj-r1 a) (obj-r1 b))
                             (< (obj-c1 a) (obj-c1 b))
                             (< (obj-r1 a) (obj-r1 b))))))
    (define (shape-key cells)
      (format "~a" (sort (normalize-cells cells)
                         (lambda (a b) (if (= (first a) (first b)) (< (second a) (second b)) (< (first a) (first b)))))))
    (define (rot90 cells)
      (let ((h (+ 1 (apply max (map first cells)))))
        (normalize-cells (map (lambda (p) (list (second p) (- h 1 (first p)))) cells))))
    (define (rotate cells k)
      (let loop ([i 0] [cur (normalize-cells cells)])
        (if (= i (modulo k 4)) cur (loop (+ i 1) (rot90 cur)))))
    (define (reflect-lr cells)
      (let* ((norm (normalize-cells cells))
             (w (+ 1 (apply max (map second norm)))))
        (normalize-cells (map (lambda (p) (list (first p) (- w 1 (second p)))) norm))))
    (define keys
      (map (lambda (o)
             (remove-duplicates
              (append* (map (lambda (k)
                              (let ((rot (rotate (obj-cells o) k)))
                                (list (shape-key rot) (shape-key (rotate (reflect-lr (obj-cells o)) k)))))
                            (list 0 1 2 3)))))
           objs))
    (define base-keys (map (lambda (o) (shape-key (normalize-cells (obj-cells o)))) objs))
    (define n (length objs))
    (grid-from-fn n n
      (lambda (r c) (if (member? (list-ref base-keys c) (list-ref keys r)) 8 0)))))

Provenance

Generator
generators/60c56114260f/generator.py
Notes and decisions
generators/60c56114260f/notes.md
Review label
reviewed_safe
Generator SHA-256
08e7159a23d9ae5c51e06e82e467e634d10acd954e48d7daa849f78ffed3401a
Rule hash
10e74a39671a
Sources
bank:0f1ff2289d6f
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 60c56114260f --count 1 --seed 20261108 --test 1