← 530e5e07db4c_2 · 531e65dffc0a →
531905d00c4b
A first all-zero row separates a left-to-right library of 3-5 distinct-color connected prototypes from a dense lower color-index matrix. Each prototype is cropped independently and top-left padded to the common maximum crop size; the lower nonzero rectangle is cropped; each index token is then replaced by its matching padded prototype with no gaps. Scheduled variants include canonical 6/7x11 layouts, vertically shifted prototypes, blank padding around the index, and non-3x3 tile sizes.
parametric familymosaic constructionprototype librarysymbolic replacement
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 (nonzero-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (crop-nonzero grid) (let ((cells (nonzero-cells grid))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))))) (define (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (e8b-paste grid pat top left) (for*/fold ((out grid)) ((r (in-range (rows pat))) (c (in-range (cols pat)))) (let ((v (at pat r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows out) (cols out))) (set-cell out rr cc v) out)))) (define (s17b-object-crop grid obj) (let ((bb (obj-bbox obj))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (s17b-object-col< a b) (let ((ba (obj-bbox a)) (bb (obj-bbox b))) (e8b-list< (list (second ba) (first ba)) (list (second bb) (first bb))))) (define (s17b-pad-top-left grid h w) (e8b-paste (empty-grid h w 0) grid 0 0)) (define (s17b-gallery-grid panel-rows (gap 1)) (let* ((all-panels (apply append panel-rows)) (ph (apply max (map rows all-panels))) (pw (apply max (map cols all-panels))) (nr (length panel-rows)) (nc (length (first panel-rows))) (out-h (+ (* nr ph) (* gap (- nr 1)))) (out-w (+ (* nc pw) (* gap (- nc 1))))) (for*/fold ((out (empty-grid out-h out-w 0))) ((rr (in-range nr)) (cc (in-range nc))) (e8b-paste out (list-ref (list-ref panel-rows rr) cc) (* rr (+ ph gap)) (* cc (+ pw gap)))))) (define (s17b-lookup-grid pairs key) (second (first (filter (lambda (kv) (= (first kv) key)) pairs)))) (let* ((sep (first (filter (lambda (r) (all? (lambda (v) (= v 0)) (row g r))) (range (rows g))))) (lib-area (subgrid g 0 0 (- sep 1) (- (cols g) 1))) (raw-index (subgrid g (+ sep 1) 0 (- (rows g) 1) (- (cols g) 1))) (index-area (crop-nonzero raw-index)) (objs (sort (objects lib-area 0) s17b-object-col<)) (ph (apply max (map (lambda (obj) (rows (s17b-object-crop lib-area obj))) objs))) (pw (apply max (map (lambda (obj) (cols (s17b-object-crop lib-area obj))) objs))) (lib (for/list ((obj (in-list objs))) (list (obj-color obj) (s17b-pad-top-left (s17b-object-crop lib-area obj) ph pw))))) (s17b-gallery-grid (for/list ((r (in-range (rows index-area)))) (for/list ((c (in-range (cols index-area)))) (s17b-lookup-grid lib (at index-area r c)))) 0))))
Provenance
- Generator
- generators/531905d00c4b/generator.py
- Notes and decisions
- generators/531905d00c4b/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 0a828b75ef0274502b74326a1cdd4605ba85fd88076fcad557ed7dcca8db90ab
- Rule hash
- 2ace815dad55
- Sources
- bank:f716aa11d181
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 531905d00c4b --count 1 --seed 20261108 --test 1