← 47993d3762b9 · 483682b75e12 →

48283e01e8ab

Recolor each 4-connected color-6 component by size, distinguishing straight and bent size-3 components.

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))
                  (result (make-hash)))
             (for* ((r (range 0 h)) (c (range 0 w)))
                   (hash-set! result (list r c) (at g r c)))
             (for* ((r (range 0 h)) (c (range 0 w)))
                   (when
                     (and (= (at g r c) 6) (not (hash-has-key? visited (list r c))))
                     (let ((cells (list)))
                       (let bfs
                            ((q (list (list r c))))
                            (unless
                              (null? q)
                              (let ((cr (first (car q)))
                                    (cc (second (car q))))
                                (cond
                                  ((or
                                     (hash-has-key? visited (list cr cc))
                                     (< cr 0)
                                     (>= cr h)
                                     (< cc 0)
                                     (>= cc w)
                                     (!= (at g cr cc) 6)) (bfs (cdr q)))
                                  (else (hash-set! visited (list cr cc) #t)
                                        (set! cells (cons (list cr cc) cells))
                                        (bfs (append (cdr q)
                                                     (list (list (- cr 1) cc)
                                                           (list (+ cr 1) cc)
                                                           (list cr (- cc 1))
                                                           (list cr (+ cc 1))))))))))
                       (let* ((n (length cells))
                              (rmin (min-of first cells))
                              (cmin (min-of second cells))
                              (rmax (max-of first cells))
                              (cmax (max-of second cells))
                              (sh (+ 1 (- rmax rmin)))
                              (sw (+ 1 (- cmax cmin)))
                              (color (cond
                                       ((= n 6) 5)
                                       ((= n 5) 3)
                                       ((= n 4) 8)
                                       ((and (= n 3) (or (= sh 1) (= sw 1))) 2)
                                       ((= n 3) 4)
                                       ((= n 2) 9)
                                       (else 6))))
                         (for ((cell cells)) (hash-set! result cell color))))))
             (cellmap g (r c v) (hash-ref result (list r c) 0))))))

Provenance

Generator
generators/48283e01e8ab/generator.py
Notes and decisions
generators/48283e01e8ab/notes.md
Review label
reviewed_safe
Generator SHA-256
7e39b033ea4ac165e40c8b2e97663b1c41f9a4203254957b8ef470c191108927
Rule hash
79a3d3708716
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 48283e01e8ab --count 1 --seed 20261108 --test 1