← 3ab9aab86992 · 3ae696dbdba9 →

3adf11522bf5

Find every globally largest all-zero square and paint their union color 1. Also paint cells belonging to any side>=2 all-zero square whose entire footprint is disjoint from that maximal union. Preserve the single nonzero obstacle 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)))
           (let* ((max-sq (cellmap g
                                   (r c v)
                                   (if (!= v 0)
                                       0
                                       (let loop
                                            ((n 1))
                                            (if (or (>= (+ r n) h) (>= (+ c n) w))
                                                n
                                                (if (for/and ((i (range 0 (+ n 1))))
                                                             (and
                                                               (zero? (at g
                                                                          (+ r n)
                                                                          (+ c i)))
                                                               (zero? (at g
                                                                          (+ r i)
                                                                          (+ c n)))))
                                                    (loop (+ n 1))
                                                    n))))))
                  (gmax (reduce (lambda (a b) (if (> a b) a b))
                                0
                                (flatmap (lambda (r)
                                           (map (lambda (c) (at max-sq r c))
                                                (range 0 w)))
                                         (range 0 h))))
                  (in-large (cellmap g
                                     (r c v)
                                     (for/or ((dr (range 0 gmax)))
                                             (for/or ((dc (range 0 gmax)))
                                                     (let ((sr (- r dr))
                                                           (sc (- c dc)))
                                                       (and
                                                         (>= sr 0)
                                                         (>= sc 0)
                                                         (< sr h)
                                                         (< sc w)
                                                         (>= (at max-sq sr sc) gmax))))))))
             (cellmap g
                      (r c v)
                      (cond
                        ((at in-large r c) 1)
                        ((!= v 0) v)
                        (else (if (for/or ((n (range 2 (+ gmax 1))))
                                          (for/or ((dr (range 0 n)))
                                                  (for/or ((dc (range 0 n)))
                                                          (let ((sr (- r dr))
                                                                (sc (- c dc)))
                                                            (and
                                                              (>= sr 0)
                                                              (>= sc 0)
                                                              (>= (at max-sq sr sc) n)
                                                              (for/and ((i (range 0 n)))
                                                                       (for/and ((j (range 0
                                                                                           n)))
                                                                                (not (at in-large
                                                                                         (+ sr
                                                                                            i)
                                                                                         (+ sc
                                                                                            j))))))))))
                                  1
                                  v))))))))

Provenance

Generator
generators/3adf11522bf5/generator.py
Notes and decisions
generators/3adf11522bf5/notes.md
Review label
reviewed_safe
Generator SHA-256
73070905c812ef39c479df6bf80b47f68b21b9b94f391f48580906c48c80d7e7
Rule hash
a18583a5c8f2
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 3adf11522bf5 --count 1 --seed 20261108 --test 1