← f4a1fcdd1c8b · f4d4fb4404c6 →

f4a7ad69b9f2

Exactly three separated monochrome objects on background 0. Crop each to its tight bbox, sort by (bbox width ASC, bbox height ASC, full crop lexicographic contents ASC), then pack left-to-right, top-aligned, with one background column between crops. Generated lessons explicitly cover width-primary, height-tie, geometry-driven lex, and color-driven lex comparisons.

cropgalleryordering

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 (flat grid) (apply append grid)) (define (obj-width-gallery< a b) (cond ((not (= (obj-w a) (obj-w b))) (< (obj-w a) (obj-w b))) ((not (= (obj-h a) (obj-h b))) (< (obj-h a) (obj-h b))) (else (lex-grid< (crop-obj g a) (crop-obj g b))))) (define (lex-list< a b) (cond ((empty? a) (not (empty? b))) ((empty? b) #f) ((not (= (first a) (first b))) (< (first a) (first b))) (else (lex-list< (rest a) (rest b))))) (define (lex-grid< a b) (lex-list< (flat a) (flat b))) (define (crop-obj grid obj) (let* ((r0 (obj-r1 obj)) (c0 (obj-c1 obj)) (h (obj-h obj)) (w (obj-w obj))) (for/fold ((out (empty-grid h w 0))) ((p (in-list (obj-cells obj)))) (set-cell out (- (first p) r0) (- (second p) c0) (at grid (first p) (second p)))))) (define (paste-crop grid crop r0 c0) (for*/fold ((out grid)) ((r (in-range (rows crop))) (c (in-range (cols crop)))) (let ((v (at crop r c)) (rr (+ r0 r)) (cc (+ c0 c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows grid) (cols grid))) (set-cell out rr cc v) out)))) (define (gallery-top crops) (if (empty? crops) (list (list 0)) (let* ((h (apply max (map rows crops))) (w (+ (apply + (map cols crops)) (max 0 (- (length crops) 1))))) (let pack ((remaining crops) (left 0) (out (empty-grid h w 0))) (if (empty? remaining) out (let ((crop (first remaining))) (pack (rest remaining) (+ left (cols crop) 1) (paste-crop out crop 0 left)))))))) (let* ((objs (sort (objects g 0) obj-width-gallery<)) (crops (map (lambda (obj) (crop-obj g obj)) objs))) (if (empty? crops) (list (list 0)) (gallery-top crops)))))

Provenance

Generator
generators/f4a7ad69b9f2/generator.py
Notes and decisions
generators/f4a7ad69b9f2/notes.md
Review label
reviewed_safe
Generator SHA-256
bebd770f37d0e7ddc3ff3d37102966ad34cefc2032f225378683bf64482fd5e8
Rule hash
16e822df83e5
Sources
bank:d994e8798bff
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate f4a7ad69b9f2 --count 1 --seed 20261108 --test 1