← 4dd0b3ed33ee · 4de2bae05c7d →

4dd7720cba5f

Split the zero-separated grid into 5x5 framed tiles, union all interior motif offsets carried by each color, and copy that union into every frame of that same color.

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))
                (rseps (filter (lambda (r)
                                 (all? (lambda (c) (zero? (at g r c))) (range 0 w)))
                               (range 0 h)))
                (cseps (filter (lambda (c)
                                 (all? (lambda (r) (zero? (at g r c))) (range 0 h)))
                               (range 0 w))))
           (define (spans seps limit)
             (let loop
                  ((xs seps) (start 0) (acc (list)))
                  (if (empty? xs)
                      (reverse (if (< start limit)
                                   (cons (list start (- limit 1)) acc)
                                   acc))
                      (let* ((sep (fst xs)))
                        (loop (cdr xs)
                              (+ sep 1)
                              (if (< start sep) (cons (list start (- sep 1)) acc) acc))))))
           (define rbands (spans rseps h))
           (define cbands (spans cseps w))
           (define tiles
             (filter (lambda (tile) (!= (third tile) 0))
                     (flatmap (lambda (rb)
                                (map (lambda (cb) (list rb cb (at g (fst rb) (fst cb))))
                                     cbands))
                              rbands)))
           (define (has-offset? color dr dc)
             (any? (lambda (tile)
                     (let* ((rb (fst tile))
                            (cb (snd tile))
                            (r (+ (fst rb) dr))
                            (c (+ (fst cb) dc)))
                       (and
                         (in-bounds? r c h w)
                         (= (third tile) color)
                         (= (at g r c) color))))
                   tiles))
           (reduce (lambda (acc tile)
                     (let* ((rb (fst tile))
                            (cb (snd tile))
                            (color (third tile))
                            (r0 (fst rb))
                            (r1 (snd rb))
                            (c0 (fst cb))
                            (c1 (snd cb))
                            (offsets (flatmap (lambda (dr)
                                                (map (lambda (dc) (list dr dc))
                                                     (range 0 (+ 1 (- c1 c0)))))
                                              (range 0 (+ 1 (- r1 r0))))))
                       (reduce (lambda (a off)
                                 (let* ((dr (fst off))
                                        (dc (snd off)))
                                   (if (has-offset? color dr dc)
                                       (set-cell a (+ r0 dr) (+ c0 dc) color)
                                       a)))
                               acc
                               offsets)))
                   g
                   tiles))))

Provenance

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