← b6452f922704 · b6592c220670 →

b650a355848c

0-bg grid (9..18) with 2-3 color-6 polyominoes (6..10 cells, bbox <= 4x4) and equally many distinct-color singleton markers near their shapes. Rule: recolor each shape by its nearest marker.

parametric family

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! (lambda (g)
         (let* ((h (rows g))
                (w (cols g)))
           (let* ((all-objs (objects g 0))
                  (shapes (filter (lambda (o) (= (obj-color o) 6)) all-objs))
                  (markers (let ((s (list)))
                             (for* ((r (range 0 h)) (c (range 0 w)))
                                   (let ((v (at g r c)))
                                     (when
                                       (and (!= v 0) (!= v 6))
                                       (set! s (cons (list r c v) s)))))
                             s))
                  (dist-to-bbox (lambda (mr mc r1 r2 c1 c2)
                                  (let ((dr (if (and (<= r1 mr) (<= mr r2))
                                                0
                                                (min (abs (- mr r1)) (abs (- mr r2)))))
                                        (dc (if (and (<= c1 mc) (<= mc c2))
                                                0
                                                (min (abs (- mc c1)) (abs (- mc c2))))))
                                    (+ dr dc))))
                  (shape-info (map (lambda (shape)
                                     (let* ((cells (obj-cells shape)))
                                       (with-bbox shape
                                                  (r1 c1 r2 c2)
                                                  (let* ((best-marker (let loop
                                                                           ((ms markers) (best #f)
                                                                             (best-dist 99999))
                                                                           (cond
                                                                             ((null? ms) best)
                                                                             (else (let* ((m (car ms))
                                                                                          (d (dist-to-bbox (first m)
                                                                                                           (second m)
                                                                                                           r1
                                                                                                           r2
                                                                                                           c1
                                                                                                           c2)))
                                                                                     (if (< d
                                                                                            best-dist)
                                                                                         (loop (cdr ms)
                                                                                               m
                                                                                               d)
                                                                                         (loop (cdr ms)
                                                                                               best
                                                                                               best-dist))))))))
                                                    (list cells
                                                          r1
                                                          r2
                                                          c1
                                                          c2
                                                          (third best-marker))))))
                                   shapes))
                  (is-vertical (> h w))
                  (sorted-shapes (sort shape-info
                                       (lambda (a b)
                                         (if is-vertical
                                             (< (second a) (second b))
                                             (< (fourth a) (fourth b))))))
                  (n (length sorted-shapes))
                  (out-h (if is-vertical (* n 4) 4))
                  (out-w (if is-vertical 4 (* n 4))))
             (build-grid out-h
                         out-w
                         (gr gc)
                         (let* ((idx (if is-vertical (quotient gr 4) (quotient gc 4)))
                                (base-r (if is-vertical (* idx 4) 0))
                                (base-c (if is-vertical 0 (* idx 4)))
                                (lr (- gr base-r))
                                (lc (- gc base-c))
                                (shape (list-ref sorted-shapes idx))
                                (cells (first shape))
                                (sr1 (second shape))
                                (sc1 (fourth shape))
                                (color (sixth shape)))
                           (let check
                                ((cs cells))
                                (cond
                                  ((null? cs) 0)
                                  ((and
                                     (= (first (car cs)) (+ sr1 lr))
                                     (= (second (car cs)) (+ sc1 lc))) color)
                                  (else (check (cdr cs)))))))))))

Provenance

Generator
generators/b650a355848c/generator.py
Notes and decisions
generators/b650a355848c/notes.md
Review label
reviewed_safe
Generator SHA-256
c1d66f3bfe7b9c25b35c37745ddf4e3630ad89c071704126847ed5028e9c9a29
Rule hash
2cb975ac778f
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate b650a355848c --count 1 --seed 20261108 --test 1