← 7213d98ef029 · 724d5770b986 →

72416068b0cf

Read the three-cell header as (shape_code, step1, step2). Match the one body object whose normalized binary crop equals the requested shape class, crop it with its original color, then apply transform step1 and transform step2 in that order. Transform codes are 1 identity, 2 rotate clockwise, 3 rotate 180, 4 rotate counterclockwise, 5 flip left-right, 6 flip up-down, and 7 transpose.

croppingshape classificationsymbolic transform sequences

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 (f14b-binary-crop grid) (crop-nonzero (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 1))))) (define (s17b-object-crop grid obj) (let ((bb (obj-bbox obj))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (s17b-transform-code grid code) (cond ((= code 1) grid) ((= code 2) (rotate-cw grid)) ((= code 3) (rotate-180 grid)) ((= code 4) (rotate-ccw grid)) ((= code 5) (flip-lr grid)) ((= code 6) (flip-ud grid)) ((= code 7) (transpose grid)) (else grid))) (let* ((shape-code (at g 0 0)) (step1 (at g 0 1)) (step2 (at g 0 2)) (target (cond ((= shape-code 1) (f14b-binary-crop (list (list 1 0) (list 1 0) (list 1 1)))) ((= shape-code 2) (f14b-binary-crop (list (list 1 1 1) (list 0 1 0)))) ((= shape-code 3) (f14b-binary-crop (list (list 1 1 0) (list 0 1 1)))) (else (f14b-binary-crop (list (list 1 1) (list 1 1) (list 1 0)))))) (work (subgrid g 1 0 (- (rows g) 1) (- (cols g) 1))) (hit (first (filter (lambda (obj) (equal? (f14b-binary-crop (s17b-object-crop work obj)) target)) (objects work 0))))) (s17b-transform-code (s17b-transform-code (s17b-object-crop work hit) step1) step2))))

Provenance

Generator
generators/72416068b0cf/generator.py
Notes and decisions
generators/72416068b0cf/notes.md
Review label
reviewed_safe
Generator SHA-256
2e09fb8f2931a6de25636484487c4bf08ccc8116428a7298ab21951042e3cfd1
Rule hash
7dc6818bbe6b
Sources
bank:5deb8ef303b3
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 72416068b0cf --count 1 --seed 20261108 --test 1