← 7195f447bb20 · 71b44cea4ed1 →
71982ba2b59e
A 0-background grid contains 3-6 separated monochrome components. Every normal draw has (1) two differently colored rotation-equivalent shapes, (2) two same-colored non-equivalent shapes, and (3) an unrelated pair. Some draws also contain a same-color, same-shape pair to show that shape equality takes precedence and still emits 8. Sort components by bounding-box (top, left); output the NxN relation matrix: diagonal = the component color, else 8 for rotation-equivalent shape, else 6 for equal color, else 0.
attribute matrixpairwise comparisonshape matching under rotation
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 dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (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 (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (e5b-nz-components grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) (reverse acc)) ((or (member? (first positions) seen) (= (at grid (first (first positions)) (second (first positions))) 0)) (loop-pos (rest positions) seen acc)) (else (let bfs ((queue (list (first positions))) (seen2 (cons (first positions) seen)) (cells (list))) (if (empty? queue) (loop-pos (rest positions) seen2 (cons (reverse cells) acc)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (not (= (at grid (first p) (second p)) 0)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells))))))))) (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 (f14b-rotations grid) (let loop ((cur (f14b-binary-crop grid)) (n 0) (acc (list))) (if (= n 4) (remove-duplicates (reverse acc)) (loop (rotate-cw cur) (+ n 1) (cons cur acc))))) (define (s6-component-grid grid cells) (let ((bb (bbox-of-cells cells))) (grid-from-fn (+ 1 (- (third bb) (first bb))) (+ 1 (- (fourth bb) (second bb))) (lambda (r c) (let ((rr (+ (first bb) r)) (cc (+ (second bb) c))) (if (member? (list rr cc) cells) (at grid rr cc) 0)))))) (define (s6b-component-crop grid cells) (s6-component-grid grid cells)) (define (s6b-shape-rotation-match? grid-a grid-b) (member? (f14b-binary-crop grid-b) (f14b-rotations grid-a))) (let* ((comps (sort (e5b-nz-components g) (lambda (a b) (let ((ba (bbox-of-cells a)) (bb (bbox-of-cells b))) (e8b-list< (list (first ba) (second ba)) (list (first bb) (second bb))))))) (grids (map (lambda (comp) (s6b-component-crop g comp)) comps)) (colors (map (lambda (comp) (at g (first (first comp)) (second (first comp)))) comps)) (n (length comps))) (grid-from-fn n n (lambda (r c) (cond ((= r c) (list-ref colors r)) ((s6b-shape-rotation-match? (list-ref grids r) (list-ref grids c)) 8) ((= (list-ref colors r) (list-ref colors c)) 6) (else 0)))))))
Provenance
- Generator
- generators/71982ba2b59e/generator.py
- Notes and decisions
- generators/71982ba2b59e/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 03556a28a93f4824586349baabea491af30fb106cd2e53a4c91ba5fae0df3357
- Rule hash
- 65d92f91150b
- Sources
- bank:529ce7614691
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 71982ba2b59e --count 1 --seed 20261108 --test 1