← e965836d9f92 · e9905db3a38d →

e971e0773705

Count isolated red top-bar and bottom-bar T-tetrominoes into capped blue and green positions of a fixed 3x6 emblem.

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)))
           (let* ((visited (make-hash))
                  (type-a 0)
                  (type-b 0))
             (for* ((r (range 0 h)) (c (range 0 w)))
                   (when
                     (and (= (at g r c) 2) (not (hash-has-key? visited (list r c))))
                     (let bfs
                          ((queue (list (list r c))) (cells (list)))
                          (cond
                            ((null? queue) (let* ((rmin (min-of first cells))
                                     (rmax (max-of first cells))
                                     (top-count (count-if (lambda (p)
                                                            (= (first p) rmin))
                                                          cells))
                                     (bot-count (count-if (lambda (p)
                                                            (= (first p) rmax))
                                                          cells)))
                                (if (>= top-count 3)
                                    (set! type-a (+ type-a 1))
                                    (set! type-b (+ type-b 1)))))
                            (else (let ((cr (first (car queue)))
                                        (cc (second (car queue))))
                                    (if (or
                                          (hash-has-key? visited (list cr cc))
                                          (< cr 0)
                                          (>= cr h)
                                          (< cc 0)
                                          (>= cc w)
                                          (!= (at g cr cc) 2))
                                        (bfs (cdr queue) cells)
                                        (begin
                                          (hash-set! visited (list cr cc) #t)
                                          (bfs (append (cdr queue)
                                                       (list (list (- cr 1) cc)
                                                             (list (+ cr 1) cc)
                                                             (list cr (- cc 1))
                                                             (list cr (+ cc 1))))
                                               (cons (list cr cc) cells))))))))))
             (let ((green-pos (list (list 0 0) (list 2 0) (list 0 2) (list 2 2)))
                   (blue-pos (list (list 0 3) (list 2 3) (list 0 5) (list 2 5)))
                   (result (make-hash)))
               (for* ((r (range 0 3)) (c (range 0 6))) (hash-set! result (list r c) 0))
               (for ((i (range 0 (min type-b 4))))
                 (let ((pos (list-ref green-pos i))) (hash-set! result pos 3)))
               (for ((i (range 0 (min type-a 4))))
                 (let ((pos (list-ref blue-pos i))) (hash-set! result pos 1)))
               (build-grid 3 6 (r c) (hash-ref result (list r c) 0)))))))

Provenance

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