← f48cc30d7943 · f4a7ad69b9f2 →
f4a1fcdd1c8b
Treat each same-color 4-connected nonzero component independently. Keep it in place when any cell touches the top, bottom, left, or right grid border; erase components that remain strictly inside the grid.
border detectionobject filteringsame-size erase
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 (object-mask obj) (let* ((r0 (obj-r1 obj)) (c0 (obj-c1 obj)) (h (obj-h obj)) (w (obj-w obj)) (cells (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) (obj-cells obj)))) (paint-cells (empty-grid h w 0) cells 1))) (define (mask-holes mask) (length (filter (lambda (region) (all? (lambda (p) (and (> (first p) 0) (< (first p) (- (rows mask) 1)) (> (second p) 0) (< (second p) (- (cols mask) 1)))) region)) (find-0-regions mask 0)))) (define (shape-perimeter obj) (let ((cells (obj-cells obj))) (for/sum ((p (in-list cells))) (count-where (lambda (d) (not (member (list (+ (first p) (first d)) (+ (second p) (second d))) cells))) cardinal-deltas)))) (define (row-symmetry obj) (let* ((r0 (obj-r1 obj)) (c0 (obj-c1 obj)) (h (obj-h obj)) (norm (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) (obj-cells obj)))) (all? (lambda (p) (member (list (- h 1 (first p)) (second p)) norm)) norm))) (define (col-symmetry obj) (let* ((r0 (obj-r1 obj)) (c0 (obj-c1 obj)) (w (obj-w obj)) (norm (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) (obj-cells obj)))) (all? (lambda (p) (member (list (first p) (- w 1 (second p))) norm)) norm))) (define (border-touch obj grid) (any? (lambda (p) (or (= (first p) 0) (= (second p) 0) (= (first p) (- (rows grid) 1)) (= (second p) (- (cols grid) 1)))) (obj-cells obj))) (define (make-comp obj grid) (let* ((mask (object-mask obj)) (rsym (row-symmetry obj)) (csym (col-symmetry obj)) (sym-count (+ (if rsym 1 0) (if csym 1 0)))) (list obj (obj-color obj) (obj-cells obj) (obj-size obj) (obj-r1 obj) (obj-c1 obj) (obj-r2 obj) (obj-c2 obj) (obj-h obj) (obj-w obj) (mask-holes mask) rsym csym sym-count (border-touch obj grid) (shape-perimeter obj)))) (define (describe-components grid) (map (lambda (obj) (make-comp obj grid)) (objects grid 0))) (define (comp-color x) (second x)) (define (comp-cells x) (third x)) (define (comp-touch x) (list-ref x 14)) (for/fold ((out (empty-grid (rows g) (cols g) 0))) ((comp (in-list (describe-components g)))) (if (comp-touch comp) (paint-cells out (comp-cells comp) (comp-color comp)) out))))
Provenance
- Generator
- generators/f4a1fcdd1c8b/generator.py
- Notes and decisions
- generators/f4a1fcdd1c8b/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 026551bf9ea3c5259b3e9350514d9c8c7c9e7d218cb3a3b431d65adb51ea6a70
- Rule hash
- 9a57908e9c92
- Sources
- bank:545aa94c7c6c
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate f4a1fcdd1c8b --count 1 --seed 20261108 --test 1