← 35368341e72e · 36343a80035c →

36275402c6b2

Find the unique largest same-colour component and crop its bounding box. Every isolated horizontal pair outside that box is read left-to-right as (replacement, source). Recolour all matching source cells inside the crop with their replacements; leave the frame cells unchanged.

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* ((nz (filter (lambda (p) (!= (at g (first p) (second p)) 0))
                              (for*/list ((r (range 0 h)) (c (range 0 w))) (list r c))))
                  (objs (objects g 0))
                  (sorted-objs (sort-by objs (lambda (o) (- (obj-size o)))))
                  (rect-obj (first sorted-objs)))
             (with-bbox rect-obj
                        (rr1 cc1 rr2 cc2)
                        (let* ((rect-h (+ (- rr2 rr1) 1))
                               (rect-w (+ (- cc2 cc1) 1))
                               (rect (subgrid g rr1 cc1 rr2 cc2))
                               (pair-cells (filter (lambda (p)
                                                     (let ((r (first p))
                                                           (c (second p)))
                                                       (not (and
                                                              (>= r rr1)
                                                              (<= r rr2)
                                                              (>= c cc1)
                                                              (<= c cc2)))))
                                                   nz))
                               (pairs (filter (lambda (p) p)
                                              (map (lambda (pc)
                                                     (let ((r (first pc))
                                                           (c (second pc)))
                                                       (and
                                                         (member (list r (+ c 1))
                                                                 pair-cells)
                                                         (list (at g r c)
                                                               (at g r (+ c 1))))))
                                                   pair-cells)))
                               (result (build-grid rect-h
                                                   rect-w
                                                   (r c)
                                                   (let* ((v (at rect r c))
                                                          (mapping (find (lambda (p)
                                                                           (= (second p)
                                                                              v))
                                                                         pairs)))
                                                     (if mapping (first mapping) v)))))
                          result))))))

Provenance

Generator
generators/36275402c6b2/generator.py
Notes and decisions
generators/36275402c6b2/notes.md
Review label
reviewed_safe
Generator SHA-256
b65d3ab83f95f86f64fee72b91222edf31101a70fb7e1770acaf67b5befc0c58
Rule hash
08894540e7f2
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 36275402c6b2 --count 1 --seed 20261108 --test 1