← c753cc4a2652 · c78d339cf2f2 →

c782972f840b

A 0-background grid contains 4-6 isolated monochrome polyominoes. Objects are compared after rotation but not reflection. Sorted by top-left position, the output relation matrix uses 9 on the diagonal, then 6/4/2/0 for same-shape+same-color / same-shape-only / same-color-only / neither.

parametric familycomponent comparisonrelation matrixrotation-invariant shape matching

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 (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 (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (f14b-binary-crop grid) (crop-nonzero (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 1))))) (define (f14b-rotations grid) (let loop ((cur (f14b-binary-crop grid)) (n 0) (acc (list))) (if (= n 4) (remove-duplicates (reverse acc)) (loop (rotate-cw cur) (+ n 1) (cons cur acc))))) (define (s17b-object-crop grid obj) (let ((bb (obj-bbox obj))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (s17b-object< a b) (let ((ba (obj-bbox a)) (bb (obj-bbox b))) (e8b-list< (list (first ba) (second ba)) (list (first bb) (second bb))))) (define (t10b-same-rot-shape? a b) (member? (f14b-binary-crop a) (f14b-rotations b))) (let* ((objs (sort (objects g 0) s17b-object<)) (n (length objs)) (crops (map (lambda (obj) (s17b-object-crop g obj)) objs))) (grid-from-fn n n (lambda (r c) (let* ((oi (list-ref objs r)) (oj (list-ref objs c)) (si (list-ref crops r)) (sj (list-ref crops c)) (ci (obj-color oi)) (cj (obj-color oj)) (same-shape (t10b-same-rot-shape? si sj))) (cond ((= r c) 9) ((and same-shape (= ci cj)) 6) ((and same-shape (not (= ci cj))) 4) ((and (not same-shape) (= ci cj)) 2) (else 0))))))))

Provenance

Generator
generators/c782972f840b/generator.py
Notes and decisions
generators/c782972f840b/notes.md
Review label
reviewed_safe
Generator SHA-256
dc8131b1802dc0d2c4495022fbab7316d1878769342c9cbbead11eb1bb2fbae8
Rule hash
1f9d3ac91fc0
Sources
bank:ad4abc25f505
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate c782972f840b --count 1 --seed 20261108 --test 1