← 88b8e6aaa49d · 891a82451a8a →
88ce0ac7322b
A 3-row strip contains three to five 3x3 tiles separated by full color-9 columns. Tile occupancies are distinct and initially unsorted; outputs sort whole tiles from fewest to most nonzero cells. A five-residue schedule includes two canonical red anchors and three two-color witness profiles; every four-pair lesson refutes red-count, modal-frequency, and raw-sum shortcuts.
cross-tile ordering, stable comparison, macro rearrangement
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 (lex< a b) (cond ((empty? a) (not (empty? b))) ((empty? b) #f) ((not (= (first a) (first b))) (< (first a) (first b))) (else (lex< (rest a) (rest b))))) (define (take-n xs n) (if (or (= n 0) (empty? xs)) (list) (cons (first xs) (take-n (rest xs) (- n 1))))) (define (drop-n xs n) (if (or (= n 0) (empty? xs)) xs (drop-n (rest xs) (- n 1)))) (define (full-row? grid r color) (all? (lambda (c) (= (at grid r c) color)) (range 0 (cols grid)))) (define (full-col? grid c color) (all? (lambda (r) (= (at grid r c) color)) (range 0 (rows grid)))) (define (segments-from-dividers n dividers) (let loop ((ds (append dividers (list n))) (prev -1) (acc (list))) (if (empty? ds) (reverse acc) (let ((x (first ds))) (loop (rest ds) x (if (> (- x prev 1) 0) (cons (list (+ prev 1) x) acc) acc)))))) (define (tile-lattice grid) (let* ((divider-rows (filter (lambda (r) (full-row? grid r 9)) (range 0 (rows grid)))) (divider-cols (filter (lambda (c) (full-col? grid c 9)) (range 0 (cols grid)))) (row-bounds (segments-from-dividers (rows grid) divider-rows)) (col-bounds (segments-from-dividers (cols grid) divider-cols))) (map (lambda (rb) (map (lambda (cb) (subgrid grid (first rb) (first cb) (- (second rb) 1) (- (second cb) 1))) col-bounds)) row-bounds))) (define (flat-tiles grid) (let* ((tiles (tile-lattice grid)) (rs (length tiles)) (cs (length (first tiles)))) (list (apply append tiles) rs cs))) (define (assemble-tiles tile-matrix) (let* ((tr (length tile-matrix)) (tc (length (first tile-matrix))) (th (rows (first (first tile-matrix)))) (tw (cols (first (first tile-matrix)))) (h (+ (* tr th) (- tr 1))) (w (+ (* tc tw) (- tc 1)))) (for*/fold ((out (empty-grid h w 9))) ((rr (in-range tr)) (cc (in-range tc)) (r (in-range th)) (c (in-range tw))) (set-cell out (+ (* rr (+ th 1)) r) (+ (* cc (+ tw 1)) c) (at (list-ref (list-ref tile-matrix rr) cc) r c))))) (define (assemble-from-flat tiles rs cs) (let build-rows ((remaining tiles) (r 0) (rows-out (list))) (if (= r rs) (assemble-tiles (reverse rows-out)) (build-rows (drop-n remaining cs) (+ r 1) (cons (take-n remaining cs) rows-out))))) (define (nonzero-count tile) (count-where (lambda (v) (not (= v 0))) (flat tile))) (define (tile-sort-by-count< a b) (let ((ca (nonzero-count a)) (cb (nonzero-count b))) (if (= ca cb) (lex< (flat a) (flat b)) (< ca cb)))) (let* ((ft (flat-tiles g)) (flat0 (first ft)) (cs (third ft)) (ordered (sort flat0 tile-sort-by-count<))) (assemble-from-flat ordered 1 cs))))
Provenance
- Generator
- generators/88ce0ac7322b/generator.py
- Notes and decisions
- generators/88ce0ac7322b/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 1428762df7b65c25e42e190c652cb3c38dd135d955592b2726cb0fcfe0e52a67
- Rule hash
- 53d8281899b9
- Sources
- bank:7f6d2146c992
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 88ce0ac7322b --count 1 --seed 20261108 --test 1