← 0ee26bf68bad · 0f075657ddbb →

0ee358bd9d75

Zero divider rows/columns form rectangular sections; emit a compact grid containing the unique dominant nonzero color of every section.

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))
                (zero-rows (filter (lambda (r)
                                     (andmap (lambda (c) (zero? (at g r c)))
                                             (range 0 w)))
                                   (range 0 h)))
                (zero-cols (filter (lambda (c)
                                     (andmap (lambda (r) (zero? (at g r c)))
                                             (range 0 h)))
                                   (range 0 w)))
                (row-bounds (append (list -1) zero-rows (list h)))
                (row-sections (map (lambda (i)
                                     (list (+ 1 (nth row-bounds i))
                                           (- (nth row-bounds (+ i 1)) 1)))
                                   (range 0 (- (length row-bounds) 1))))
                (col-bounds (append (list -1) zero-cols (list w)))
                (col-sections (map (lambda (i)
                                     (list (+ 1 (nth col-bounds i))
                                           (- (nth col-bounds (+ i 1)) 1)))
                                   (range 0 (- (length col-bounds) 1))))
                (dominant (lambda (r1 r2 c1 c2)
                            (let* ((vals (flatmap (lambda (r)
                                                    (filter (lambda (v) (!= 0 v))
                                                            (map (lambda (c) (at g r c))
                                                                 (range c1 (+ c2 1)))))
                                                  (range r1 (+ r2 1))))
                                   (uniq (unique vals))
                                   (counts (map (lambda (v)
                                                  (list v
                                                        (count-if (lambda (x) (= x v))
                                                                  vals)))
                                                uniq))
                                   (sorted (sort-by counts (lambda (p) (- (second p))))))
                              (first (first sorted)))))
                (oh (length row-sections))
                (ow (length col-sections)))
           (build-grid oh
                       ow
                       (rr cc)
                       (let ((rsec (nth row-sections rr))
                             (csec (nth col-sections cc)))
                         (dominant (first rsec)
                                   (second rsec)
                                   (first csec)
                                   (second csec)))))))

Provenance

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