← b35816e8388b · b37eb391ddc0 →
b3750af4dac1
A 1/7/9 wall lattice contains row-major rooms. Color 7 is a doorway; match the first room's exact (area, door-degree, #2, #3) signature and mark the unique matching candidate in a one-row color-8 strip.
parametric familycompound room signatures, degree + area + counts, symbolic selection
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 (wall? v) (member? v (list 1 7 9))) (define (make-room id cells) (let* ((bb (bbox-of-cells cells)) (r (first bb)) (c (second bb)) (h (+ 1 (- (third bb) r))) (w (+ 1 (- (fourth bb) c)))) (list id cells (list r c h w)))) (define (room-id room) (first room)) (define (room-cells room) (second room)) (define (room-bbox room) (third room)) (define (room-r room) (first (room-bbox room))) (define (room-c room) (second (room-bbox room))) (define (room-order rooms) (sort (map room-id rooms) (lambda (a b) (let ((ra (list-ref rooms a)) (rb (list-ref rooms b))) (if (= (room-r ra) (room-r rb)) (< (room-c ra) (room-c rb)) (< (room-r ra) (room-r rb))))))) (define (extract-room-data grid) (define seen (make-hash)) (define cell-to-rid (make-hash)) (define rooms (list)) (for* ((r (in-range (rows grid))) (c (in-range (cols grid)))) (when (and (not (wall? (at grid r c))) (not (hash-has-key? seen (list r c)))) (define cells (connected-region grid r c (lambda (rr cc v) (not (wall? v))) 4)) (define id (length rooms)) (for ((p (in-list cells))) (hash-set! seen p #t) (hash-set! cell-to-rid p id)) (set! rooms (append rooms (list (make-room id cells)))))) (list rooms cell-to-rid)) (define (room-graph grid) (let* ((data (extract-room-data grid)) (rooms (first data)) (cell-to-rid (second data)) (adj (make-hash))) (for ((room (in-list rooms))) (hash-set! adj (room-id room) (list))) (define (add-edge a b) (hash-set! adj a (sort (remove-duplicates (cons b (hash-ref adj a (list)))) <)) (hash-set! adj b (sort (remove-duplicates (cons a (hash-ref adj b (list)))) <))) (for* ((r (in-range (rows grid))) (c (in-range (cols grid)))) (when (= (at grid r c) 7) (define ids (remove-duplicates (filter number? (map (lambda (d) (hash-ref cell-to-rid (list (+ r (first d)) (+ c (second d))) #f)) cardinal-deltas)))) (for* ((a (in-list ids)) (col (in-list ids))) (when (< a col) (add-edge a col))))) (list rooms adj cell-to-rid))) (define (strip-mark n idxs (color 8)) (grid-from-fn 1 n (lambda (r c) (if (member? c idxs) color 0)))) (define (room-signature grid adj room) (list (length (room-cells room)) (length (hash-ref adj (room-id room))) (count-where (lambda (p) (= (at grid (first p) (second p)) 2)) (room-cells room)) (count-where (lambda (p) (= (at grid (first p) (second p)) 3)) (room-cells room)))) (let* ((rg (room-graph g)) (rooms (first rg)) (adj (second rg)) (order (room-order rooms)) (query (list-ref rooms (first order))) (qsig (room-signature g adj query)) (cands (rest order)) (idxs (map first (filter (lambda (pair) (equal? (room-signature g adj (list-ref rooms (second pair))) qsig)) (enumerate-list cands))))) (strip-mark (length cands) idxs 8))))
Provenance
- Generator
- generators/b3750af4dac1/generator.py
- Notes and decisions
- generators/b3750af4dac1/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- c53fc9358c39c9c48fc9a67c7672251919bf7856e7dcc6fc2442189c73a7b92b
- Rule hash
- 674e022a164b
- Sources
- bank:445ef4275a64
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate b3750af4dac1 --count 1 --seed 20261108 --test 1