← 151f4dc0c08f · 1569ecfa4ff1 →

155cf6b30713

Infer an exact-position dihedral transform and color mapping from panels 1→2, then apply both to panel 3 while preserving unmapped query colors.

parametric family

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 (binary-grid grid) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 1)))) (define (split-panels-row grid count) (let* ((panel-w (quotient (- (cols grid) (- count 1)) count))) (for/list ((i (in-range count))) (let ((left (* i (+ panel-w 1)))) (subgrid grid 0 left (- (rows grid) 1) (+ left panel-w -1)))))) (define transform-names (list 'id 'rot90 'rot180 'rot270 'flip-h 'flip-v 'transpose 'anti-transpose)) (define (anti-transpose-grid grid) (rotate-180 (transpose grid))) (define (apply-transform-name name grid) (cond ((equal? name 'id) grid) ((equal? name 'rot90) (rotate-cw grid)) ((equal? name 'rot180) (rotate-180 grid)) ((equal? name 'rot270) (rotate-ccw grid)) ((equal? name 'flip-h) (flip-lr grid)) ((equal? name 'flip-v) (flip-ud grid)) ((equal? name 'transpose) (transpose grid)) (else (anti-transpose-grid grid)))) (define (infer-support-transform-exact a b) (let ((target (binary-grid b))) (first (filter (lambda (name) (equal? (apply-transform-name name (binary-grid a)) target)) transform-names)))) (let* ((panels (split-panels-row g 3)) (ex-in (first panels)) (ex-out (second panels)) (query (third panels)) (name (infer-support-transform-exact ex-in ex-out)) (tq (apply-transform-name name query)) (tex (apply-transform-name name ex-in)) (mapping (filter values (for*/list ((r (in-range (rows ex-out))) (c (in-range (cols ex-out)))) (let ((a (at tex r c)) (b (at ex-out r c))) (if (and (not (= a 0)) (not (= b 0))) (list a b) #f)))))) (grid-from-fn (rows tq) (cols tq) (lambda (r c) (let* ((v (at tq r c)) (hit (filter (lambda (p) (= (first p) v)) mapping))) (if (and (not (= v 0)) (not (empty? hit))) (second (first hit)) v)))))))

Provenance

Generator
generators/155cf6b30713/generator.py
Notes and decisions
generators/155cf6b30713/notes.md
Review label
reviewed_safe
Generator SHA-256
8eadbf6dd0d5fd933526ff4edcc2b019baa7f6d82ad4482230218b322c4849c3
Rule hash
c4019681eb48
Sources
bank:7d2e04a04712
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 155cf6b30713 --count 1 --seed 20261108 --test 1