← 5d6fcce80b6a · 5da2f80a4a4f →

5d9c166a8c3b

A black grid contains one non-red foreground color split into disconnected objects. Merge object groups to a fixed point whenever their bounding boxes share any row or any column. For every final group, fill background cells inside its merged bounding box red (2), preserving all original objects. Generated lessons rotate through row links, column links, and a three-object row-then-column chain that requires transitive fixed-point merging.

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)))
           (begin
             (define comps (objects g 0))
             (define (cells-bbox cells)
               (let ((rs (map first cells))
                     (cs (map second cells)))
                 (list (min-list rs) (min-list cs) (max-list rs) (max-list cs))))
             (define (boxes-overlap? b1 b2)
               (let ((r1a (first b1))
                     (c1a (second b1))
                     (r1b (third b1))
                     (c1b (nth b1 3))
                     (r2a (first b2))
                     (c2a (second b2))
                     (r2b (third b2))
                     (c2b (nth b2 3)))
                 (or
                   (not (or (< r1b r2a) (< r2b r1a)))
                   (not (or (< c1b c2a) (< c2b c1a))))))
             (define groups (map obj-cells comps))
             (define (do-merge gs)
               (if (or (null? gs) (null? (cdr gs)))
                   gs
                   (let* ((cur (first gs))
                          (rest (cdr gs))
                          (bb-cur (cells-bbox cur))
                          (matches (filter (lambda (g)
                                             (boxes-overlap? bb-cur (cells-bbox g)))
                                           rest))
                          (non-matches (filter (lambda (g)
                                                 (not (boxes-overlap? bb-cur
                                                                      (cells-bbox g))))
                                               rest)))
                     (if (null? matches)
                         (cons cur (do-merge rest))
                         (do-merge (cons (apply append (cons cur matches)) non-matches))))))
             (define (merge-fixed gs)
               (let ((m (do-merge gs)))
                 (if (= (length m) (length gs)) m (merge-fixed m))))
             (define merged-groups (merge-fixed groups))
             (reduce (lambda (gg group)
                       (let* ((bb (cells-bbox group))
                              (r1 (first bb))
                              (c1 (second bb))
                              (r2 (third bb))
                              (c2 (nth bb 3))
                              (cells (flatmap (lambda (r)
                                                (map (lambda (c) (list r c))
                                                     (range c1 (+ c2 1))))
                                              (range r1 (+ r2 1)))))
                         (reduce (lambda (gg2 rc)
                                   (if (zero? (at g (first rc) (second rc)))
                                       (set-cell gg2 (first rc) (second rc) 2)
                                       gg2))
                                 gg
                                 cells)))
                     g
                     merged-groups)))))

Provenance

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