← 70b9864c90a3 · 70c9dccdcc4d →

70c33a3391ac

Find all four-connected nonzero components, crop each component to its bounding box while preserving every color and internal zero, and compare the complete crops exactly. Exactly one crop occurs twice; output that duplicated colored crop. Geometry alone, palette alone, cell count, size, position, and modal color are insufficient.

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* ((visited (make-hash))
                  (obj-grids (list)))
             (for* ((r (range 0 h)) (c (range 0 w)))
                   (when
                     (and (!= (at g r c) 0) (not (hash-has-key? visited (list r c))))
                     (let ((cells (list)))
                       (let bfs
                            ((queue (list (list r c))))
                            (unless
                              (null? queue)
                              (let ((cur (car queue)))
                                (cond
                                  ((hash-has-key? visited cur) (bfs (cdr queue)))
                                  ((or
                                     (< (first cur) 0)
                                     (>= (first cur) h)
                                     (< (second cur) 0)
                                     (>= (second cur) w)) (bfs (cdr queue)))
                                  ((zero? (at g (first cur) (second cur))) (bfs (cdr queue)))
                                  (else (hash-set! visited cur #t)
                                        (set! cells (cons cur cells))
                                        (let ((cr (first cur))
                                              (cc (second cur)))
                                          (bfs (append (cdr queue)
                                                       (list (list (- cr 1) cc)
                                                             (list (+ cr 1) cc)
                                                             (list cr (- cc 1))
                                                             (list cr (+ cc 1)))))))))))
                       (let* ((rs (map first cells))
                              (cs (map second cells))
                              (r1 (min-list rs))
                              (c1 (min-list cs))
                              (r2 (max-list rs))
                              (c2 (max-list cs))
                              (sub (build-grid (+ 1 (- r2 r1))
                                               (+ 1 (- c2 c1))
                                               (rr cc)
                                               (at g (+ r1 rr) (+ c1 cc)))))
                         (set! obj-grids (cons sub obj-grids))))))
             (let ((n (length obj-grids)))
               (let find-dup
                    ((i 0))
                    (if (>= i n)
                        (build-grid 1 1 (r c) 0)
                        (let ((gi (list-ref obj-grids i)))
                          (if (> (count-if (lambda (gj)
                                             (and
                                               (= (rows gi) (rows gj))
                                               (= (cols gi) (cols gj))
                                               (let check
                                                    ((rr 0))
                                                    (cond
                                                      ((>= rr (rows gi)) #t)
                                                      ((let col-check
                                                            ((cc 0))
                                                            (cond
                                                              ((>= cc (cols gi)) #t)
                                                              ((= (at gi rr cc)
                                                                  (at gj rr cc)) (col-check (+ cc 1)))
                                                              (else #f))) (check (+ rr 1)))
                                                      (else #f)))))
                                           obj-grids)
                                 1)
                              gi
                              (find-dup (+ i 1)))))))))))

Provenance

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