← 9ea9f1e62275 · 9ee024f29fdb →

9edcccd1341f

Preserve the nonzero key row. In the framed area, find the unique most-frequent non-border interior color. Recolor the outer frame with that winner, draw a hollow winner-colored frame around all winner cells' bounding box, and clear the remaining interior.

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!
 ;; Keep the color key unchanged. Inside the old frame, the unique most-common
 ;; nonzero color other than the frame color selects both the replacement color
 ;; and the cells whose bounding box becomes the inner hollow rectangle.
 (lambda (g)
   (let* ((h (rows g))
          (w (cols g))
          ;; The uniform outer frame begins at row 1; row 0 is the preserved key.
          (bdr (at g 1 0))
          ;; Each entry is (row column color) for a non-background, non-frame
          ;; interior cell.
          (interior
           (for*/list ((r (range 2 (- h 1)))
                       (c (range 1 (- w 1)))
                       #:when (let ((v (at g r c)))
                                (and (!= v 0) (!= v bdr))))
             (list r c (at g r c))))
          (colors (unique (map third interior)))
          (counts
           (map (lambda (clr)
                  (list clr
                        (count-if (lambda (cell) (= (third cell) clr))
                                  interior)))
                colors))
          ;; The task grammar guarantees one strict frequency maximum.
          (winner (first (pick-max counts second)))
          (win-cells (filter (lambda (cell) (= (third cell) winner))
                             interior))
          (r1 (min-of first win-cells))
          (r2 (max-of first win-cells))
          (c1 (min-of second win-cells))
          (c2 (max-of second win-cells)))
     (cellmap g (r c v)
       (cond
         ;; Preserve the key row verbatim.
         ((zero? r) v)
         ;; Recolor the full old outer frame with the winner.
         ((or (= r 1) (= r (- h 1)) (zero? c) (= c (- w 1))) winner)
         ;; Draw the winner bounding box as a hollow rectangle.
         ((or (and (or (= r r1) (= r r2)) (>= c c1) (<= c c2))
              (and (or (= c c1) (= c c2)) (>= r r1) (<= r r2)))
          winner)
         ;; Drop every original interior cell not on that hollow rectangle.
         (else 0))))))

Provenance

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