← 2f0a4d589c58 · 2f4a0e633093 →

2f0f072d3d7e

Square panels A, B, C and 2..3 candidates are separated by color 9. Infer the first rotation/reflection mapping normalized A to B, apply it to normalized C, then return the unique matching candidate at its original offset recolored 8.

transform inference, dihedral/rotation reasoning, candidate selection

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 (render-same-size cells h w (color 8)) (paint-cells (empty-grid h w 0) (filter (lambda (p) (in-bounds? (first p) (second p) h w)) cells) color)) (define (panel-occ panel) (sort (filter (lambda (p) (let ((v (at panel (first p) (second p)))) (and (not (= v 0)) (not (= v 9))))) (grid-positions panel)) cell<)) (define (recolor-panel panel (color 8)) (render-same-size (panel-occ panel) (rows panel) (cols panel) color)) (define (split-cols-9 grid) (let loop ((c 0) (start 0) (acc (list))) (cond ((>= c (cols grid)) (reverse (if (< start (cols grid)) (cons (subgrid grid 0 start (- (rows grid) 1) (- (cols grid) 1)) acc) acc))) ((all? (lambda (r) (= (at grid r c) 9)) (range 0 (rows grid))) (let scan ((cc c)) (if (and (< cc (cols grid)) (all? (lambda (r) (= (at grid r cc) 9)) (range 0 (rows grid)))) (scan (+ cc 1)) (loop cc cc (if (< start c) (cons (subgrid grid 0 start (- (rows grid) 1) (- c 1)) acc) acc))))) (else (loop (+ c 1) start acc))))) (define (normalize-cells cells) (if (empty? cells) (list) (let* ((r0 (apply min (map first cells))) (c0 (apply min (map second cells)))) (sort (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) cells) cell<)))) (define (rotate-cells cells) (let* ((norm (normalize-cells cells))) (if (empty? norm) norm (let ((h (+ 1 (apply max (map first norm))))) (normalize-cells (map (lambda (p) (list (second p) (- h 1 (first p)))) norm)))))) (define (rotate-times-cells cells k) (let loop ((cur cells) (n (modulo k 4))) (if (= n 0) (normalize-cells cur) (loop (rotate-cells cur) (- n 1))))) (define (reflect-h-cells cells) (let* ((norm (normalize-cells cells))) (if (empty? norm) norm (let ((w (+ 1 (apply max (map second norm))))) (normalize-cells (map (lambda (p) (list (first p) (- w 1 (second p)))) norm)))))) (define (identify-transform a b) (let ((target (normalize-cells (panel-occ b))) (src (panel-occ a))) (let loop ((k 0)) (cond ((= k 4) (if (equal? (normalize-cells (reflect-h-cells src)) target) 4 0)) ((equal? (normalize-cells (rotate-times-cells src k)) target) k) (else (loop (+ k 1))))))) (define (apply-cell-transform cells code) (if (= code 4) (reflect-h-cells cells) (rotate-times-cells cells code))) (let* ((panels (split-cols-9 g)) (a (first panels)) (b (second panels)) (c (third panels)) (cands (rest (rest (rest panels)))) (code (identify-transform a b)) (target (normalize-cells (apply-cell-transform (panel-occ c) code))) (chosen (find-first (lambda (p) (equal? (normalize-cells (panel-occ p)) target)) cands))) (if (eq? chosen #f) (empty-grid (rows (first cands)) (cols (first cands)) 0) (recolor-panel chosen 8)))))

Provenance

Generator
generators/2f0f072d3d7e/generator.py
Notes and decisions
generators/2f0f072d3d7e/notes.md
Review label
reviewed_safe
Generator SHA-256
221970f06f2831e2a8a0f7d3f06abbf4e57cf0a722fefbaf3ccb2e3bf8876c15
Rule hash
5c71009c7048
Sources
bank:0938460c498b
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 2f0f072d3d7e --count 1 --seed 20261108 --test 1