← 17f92e205b34 · 1856980929fe →

185447d509d8

Find the four isolated coloured objects in row-major bounding-box order. Emit a 4x4 red(2)/black(0) matrix whose entries mark whether each pair of binary shapes is identical under any of the eight dihedral symmetries.

dihedral reasoningrelation matrix constructionshape 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).

Original task pairs

From the source task; the reference rule must reproduce them.

Reference rule (Racket)

(rule! (let ((dummy 0)) (define (nonzero-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (component-grid obj) (let* ((bb (obj-bbox obj)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (for/fold ((out (empty-grid h w 0))) ((p (in-list (obj-cells obj)))) (set-cell out (- (first p) (first bb)) (- (second p) (second bb)) (obj-color obj))))) (define (crop-nonzero grid) (let ((cells (nonzero-cells grid))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))))) (define (binary-grid grid) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 1)))) (define (normalize-binary grid) (binary-grid (crop-nonzero grid))) (define (all-rot-supports grid) (remove-duplicates (map normalize-binary (let* ((r0 grid) (r1 (rotate-cw r0)) (r2 (rotate-cw r1)) (r3 (rotate-cw r2))) (list r0 r1 r2 r3))))) (define (all-dihedral-supports grid) (remove-duplicates (append (all-rot-supports grid) (all-rot-supports (flip-lr grid))))) (let* ((objs (sort (objects g 0) (lambda (a b) (let ((ba (obj-bbox a)) (bb (obj-bbox b))) (if (= (first ba) (first bb)) (< (second ba) (second bb)) (< (first ba) (first bb))))))) (norms (map (lambda (obj) (binary-grid (component-grid obj))) objs)) (n (length norms))) (grid-from-fn n n (lambda (i j) (if (member? (list-ref norms j) (all-dihedral-supports (list-ref norms i))) 2 0))))))

Provenance

Generator
generators/185447d509d8/generator.py
Notes and decisions
generators/185447d509d8/notes.md
Review label
reviewed_safe
Generator SHA-256
f64540d7798e08e16bc7a4fd0ea90a6e572755e3050aac5fb5c2257368e703a3
Rule hash
9586787e3555
Sources
bank:01130745873d
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 185447d509d8 --count 1 --seed 20261108 --test 1