← fc5f4c1fd7c2 · fc999420d3aa →

fc814cec3976

Find dense-noise 3x3 red/gray candidates, rank them by red count and reading order, greedily reject candidates that reuse covered red cells, then recolor selected gray cells orange with yellow centers.

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 (rect-cells r c) (positions-in-rect r c (+ r 2) (+ c 2)))
             (define (all-2-or-5? cells)
               (for/and ((p cells))
                        (let ((v (at g (first p) (second p)))) (or (= v 2) (= v 5)))))
             (define candidates
               (sort (filter identity
                             (for*/list ((r (range 0 (- h 2))) (c (range 0 (- w 2))))
                               (let* ((cells (rect-cells r c))
                                      (covered-twos (filter (lambda (p)
                                                              (= (at g
                                                                     (first p)
                                                                     (second p))
                                                                 2))
                                                            cells)))
                                 (and
                                   (and
                                     (not (empty? covered-twos))
                                     (= (at g (+ r 1) (+ c 1)) 5)
                                     (all-2-or-5? cells))
                                   (list r c cells covered-twos (length covered-twos))))))
                     (lambda (a b)
                       (let ((ca (fifth a))
                             (cb (fifth b)))
                         (or
                           (> ca cb)
                           (and
                             (= ca cb)
                             (or
                               (< (first a) (first b))
                               (and (= (first a) (first b)) (< (second a) (second b))))))))))
             (define selected
               (let loop
                    ((cs candidates) (covered (list)) (sel (list)))
                    (if (empty? cs)
                        (reverse sel)
                        (let* ((cand (first cs))
                               (ctwos (fourth cand))
                               (overlap? (for/or ((p ctwos)) (member p covered))))
                          (if overlap?
                              (loop (rest cs) covered sel)
                              (loop (rest cs) (append covered ctwos) (cons cand sel)))))))
             (define (hit-cand r c)
               (find-first (lambda (cand) (member (list r c) (third cand))) selected))
             (cellmap g
                      (r c v)
                      (let ((cand (hit-cand r c)))
                        (if (and cand (= v 5))
                            (if (and (= r (+ (first cand) 1)) (= c (+ (second cand) 1)))
                                4
                                7)
                            v)))))))

Provenance

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