← 348efda982ab · 34f8510e39d0 →

34abaec056ef

Normalize the color-2/3/4 cardinal frame and emit a 3x3 map of only the local color-8 cells; ignore other colors and radius-2 markers.

canonicalization, symbolic output, local neighborhood encoding

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 (point< a b) (cond ((not (= (first a) (first b))) (< (first a) (first b))) ((not (= (second a) (second b))) (< (second a) (second b))) (else (< (third a) (third b))))) (define (make-frame origin vx vy colors) (list origin vx vy colors)) (define (frame-origin f) (first f)) (define (frame-vx f) (second f)) (define (frame-vy f) (third f)) (define (frame< a b) (let ((oa (frame-origin a)) (ob (frame-origin b)) (vxa (frame-vx a)) (vxb (frame-vx b)) (vya (frame-vy a)) (vyb (frame-vy b))) (cond ((not (= (first oa) (first ob))) (< (first oa) (first ob))) ((not (= (second oa) (second ob))) (< (second oa) (second ob))) ((not (= (first vxa) (first vxb))) (< (first vxa) (first vxb))) ((not (= (second vxa) (second vxb))) (< (second vxa) (second vxb))) ((not (= (first vya) (first vyb))) (< (first vya) (first vyb))) (else (< (second vya) (second vyb)))))) (define (lpos frame p) (let* ((origin (frame-origin frame)) (dr (- (first p) (first origin))) (dc (- (second p) (second origin))) (vx (frame-vx frame)) (vy (frame-vy frame))) (list (+ (* dr (first vx)) (* dc (second vx))) (+ (* dr (first vy)) (* dc (second vy)))))) (define (find-frames grid colors) (let* ((a (first colors)) (b (second colors)) (c (third colors)) (raw (filter values (for*/list ((r (in-range (rows grid))) (col (in-range (cols grid))) (dx (in-list cardinal-deltas)) (dy (in-list cardinal-deltas))) (let* ((xr (+ r (first dx))) (xc (+ col (second dx))) (yr (+ r (first dy))) (yc (+ col (second dy)))) (if (and (= (at grid r col) a) (in-bounds? xr xc (rows grid) (cols grid)) (in-bounds? yr yc (rows grid) (cols grid)) (= (at grid xr xc) b) (= (at grid yr yc) c) (= (+ (* (first dx) (first dy)) (* (second dx) (second dy))) 0)) (make-frame (list r col) dx dy colors) #f)))))) (sort (remove-duplicates raw) frame<))) (define (extract-local-points grid frame colors radius) (let ((rad (min radius 3))) (sort (filter values (for*/list ((r (in-range (rows grid))) (c (in-range (cols grid)))) (let ((v (at grid r c))) (if (member? v colors) (let ((uv (lpos frame (list r c)))) (if (<= (max (abs (first uv)) (abs (second uv))) rad) (list (first uv) (second uv) v) #f)) #f)))) point<))) (define (point-uv p) (list (first p) (second p))) (define (point-uvs points) (map point-uv points)) (let* ((sf (first (find-frames g (list 2 3 4)))) (uvs (point-uvs (extract-local-points g sf (list 8) 2)))) (grid-from-fn 3 3 (lambda (r c) (let ((uv (list (- c 1) (- r 1)))) (if (member? uv uvs) 8 0)))))))

Provenance

Generator
generators/34abaec056ef/generator.py
Notes and decisions
generators/34abaec056ef/notes.md
Review label
reviewed_safe
Generator SHA-256
bc8a2d1e37c1551c3f666c4b572f2a06fd3aafbb99f60dbb6de277388b7b9c2c
Rule hash
8623727f72da
Sources
bank:f05110b6a734
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 34abaec056ef --count 1 --seed 20261108 --test 1