← 148acacd84d9 · 14c5c68b0201 →
148cea0afb09
Cell (0,0) contains a one-based rank R. Clear it, find the 2-3 4-connected nonzero objects, sort them by CELL COUNT ascending, choose the R-th object, crop it to its tight bbox, and scale the crop 2x2. Generated lessons deliberately distinguish cell-count rank from the canonical-fitting bbox-area shortcut.
area rankingcropping and scalinglegend decoding
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! (let ((dummy 0)) (define dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (define (components-any-nonzero grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) (reverse acc)) ((or (member? (first positions) seen) (= (at grid (first (first positions)) (second (first positions))) 0)) (loop-pos (rest positions) seen acc)) (else (let bfs ((queue (list (first positions))) (seen2 (cons (first positions) seen)) (cells (list))) (if (empty? queue) (loop-pos (rest positions) seen2 (cons (sort cells cell<) acc)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (not (= (at grid (first p) (second p)) 0)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells))))))))) (define (scale2-grid grid) (apply append (for/list ((row (in-list grid))) (let ((expanded (apply append (map (lambda (v) (list v v)) row)))) (list expanded expanded))))) (define (component-grid-cells grid cells) (let* ((bb (bbox-of-cells cells)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (for/fold ((out (empty-grid h w 0))) ((p (in-list cells))) (set-cell out (- (first p) (first bb)) (- (second p) (second bb)) (at grid (first p) (second p)))))) (let* ((rank (at g 0 0)) (gg (set-cell g 0 0 0)) (comps (sort (components-any-nonzero gg) (lambda (a b) (< (length a) (length b))))) (target (list-ref comps (- rank 1)))) (scale2-grid (component-grid-cells gg target)))))
Provenance
- Generator
- generators/148cea0afb09/generator.py
- Notes and decisions
- generators/148cea0afb09/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 535633b6aff64fd4249d9f481756f725c0cbfa76b9cd0376a248ac054ac07b12
- Rule hash
- c113614858b9
- Sources
- bank:0eb6e7ee3b18
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 148cea0afb09 --count 1 --seed 20261108 --test 1