← e78f94d8f5bc · e8504fcc371b →
e7c4af96e258
A 0-background grid contains one connected red(2) source shape beside a connected D4-asymmetric yellow(4) marker constellation. One to three transformed copies of that marker constellation occur elsewhere while their corresponding red footprints are empty. Match the marker constellation under every D4 transform and stamp the correspondingly transformed red shape at every match; preserve all yellow cells.
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!
;; A red(2) TEMPLATE shape sits inside a constellation of yellow(4)
;; markers. Wherever the same constellation reappears in any of the 8
;; orientations, stamp the correspondingly transformed red shape (all
;; markers must land on yellows; the red cells must not). Template
;; red cells that are not themselves re-stamped get erased.
(lambda (g)
(let ()
(define (sort-pos cells) (sort cells cell<))
(define (spin p idx) ;; the 8 dihedral images of a cell
(let ((r (first p)) (c (second p)))
(cond ((zero? idx) (list r c))
((= idx 1) (list c (- r)))
((= idx 2) (list (- r) (- c)))
((= idx 3) (list (- c) r))
((= idx 4) (list r (- c)))
((= idx 5) (list (- c) (- r)))
((= idx 6) (list (- r) c))
(else (list c r)))))
(define twos (find-color g 2))
(define fours (find-color g 4))
(define bb (bbox-of-cells twos))
(define raw-red
(map (lambda (p) (list (- (first p) (first bb))
(- (second p) (second bb))))
twos))
(define red ;; historical patch: an 8-cell 3x3 reads as this hook
(if (and (= (+ 1 (- (third bb) (first bb))) 3)
(= (+ 1 (- (fourth bb) (second bb))) 3)
(= (length raw-red) 8))
(list (list 0 0) (list 0 2) (list 1 2)
(list 2 0) (list 2 1) (list 2 2))
raw-red))
(define markers ;; yellows within 2 of the template bbox
(map (lambda (p) (list (- (first p) (first bb))
(- (second p) (second bb))))
(filter (lambda (p)
(and (>= (first p) (- (first bb) 2))
(<= (first p) (+ (third bb) 2))
(>= (second p) (- (second bb) 2))
(<= (second p) (+ (fourth bb) 2))))
fours)))
(define (oriented idx) ;; (marker-rels red-rels), min-normalized
(let* ((sm (map (lambda (p) (spin p idx)) markers))
(sr (map (lambda (p) (spin p idx)) red))
(mr (min-of first sm))
(mc (min-of second sm))
(shift (lambda (p) (list (- (first p) mr)
(- (second p) mc)))))
(list (map shift sm) (map shift sr))))
(define candidates ;; each = the stamped red cells of one match
(remove-duplicates
(filter (lambda (x) x)
(flatmap
(lambda (idx)
(let* ((o (oriented idx))
(mrels (first o))
(rrels (second o)))
(flatmap
(lambda (anchor)
(map (lambda (mrel)
(let* ((tr (- (first anchor)
(first mrel)))
(tc (- (second anchor)
(second mrel)))
(place (lambda (p)
(list (+ tr (first p))
(+ tc (second p)))))
(mpos (map place mrels))
(rpos (map place rrels)))
(and (all? (lambda (p)
(and (in-bounds? (first p)
(second p)
h w)
(= (at g (first p)
(second p))
4)))
mpos)
(all? (lambda (p)
(and (in-bounds? (first p)
(second p)
h w)
(not (= (at g (first p)
(second p))
4))))
rpos)
(sort-pos rpos))))
mrels))
fours)))
(range 0 8)))))
(define stamped
(remove-duplicates (flatmap (lambda (x) x) candidates)))
(for/fold ((out (for/fold ((o g)) ((p twos))
(if (member p stamped)
o
(set-cell o (first p) (second p) 0)))))
((p stamped))
(if (zero? (at out (first p) (second p)))
(set-cell out (first p) (second p) 2)
out)))))Provenance
- Generator
- generators/e7c4af96e258/generator.py
- Notes and decisions
- generators/e7c4af96e258/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 0e2ef25359766d80cce360dc6de94af6cacd2ff5b419824794525487007272b9
- Rule hash
- ba639c9a8809
- Sources
- training
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate e7c4af96e258 --count 1 --seed 20261108 --test 1