← 90e1b47a15f9 · 9126300ec565 →

90fdcc9074f8

Three same-size color panels separated by color-9 columns; noisy panel disagreements are majority-repaired by the rule.

parametric familypanel aggregation, denoising, numeric depth output

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 (keep-cell? v) (and (not (= v 0)) (not (= v 9)))) (define (shape-mask grid) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (keep-cell? (at grid r c)) 1 0)))) (define (min-row cells) (apply min (map first cells))) (define (min-col cells) (apply min (map second cells))) (define (component< a b) (let ((ac (obj-cells a)) (bc (obj-cells b))) (if (= (min-col ac) (min-col bc)) (< (min-row ac) (min-row bc)) (< (min-col ac) (min-col bc))))) (define (component-masks grid) (let ((mask (shape-mask grid))) (map (lambda (obj) (paint-cells (empty-grid (rows grid) (cols grid) 0) (obj-cells obj) 1)) (sort (objects mask 0) component<)))) (define (mask-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (boundary-cell? p cur) (any? (lambda (d) (let ((rr (+ (first p) (first d))) (cc (+ (second p) (second d)))) (or (not (in-bounds? rr cc (rows g) (cols g))) (not (member? (list rr cc) cur))))) cardinal-deltas)) (define (peel-component layers cur depth) (if (empty? cur) layers (let* ((boundary (filter (lambda (p) (boundary-cell? p cur)) cur)) (next-layers (paint-cells layers boundary depth)) (remaining (filter (lambda (p) (not (member? p boundary))) cur))) (peel-component next-layers remaining (+ depth 1))))) (define (onion-layers grid) (for/fold ((layers (empty-grid (rows grid) (cols grid) 0))) ((comp (in-list (component-masks grid)))) (peel-component layers (mask-cells comp) 1))) (define (crop-nonzero grid) (let ((cells (filter (lambda (p) (keep-cell? (at grid (first p) (second p)))) (grid-positions grid)))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb))) (subgrid grid r0 c0 r1 c1))))) (define (extract-panels grid) (let scan ((c 0) (start 0) (acc (list))) (cond ((= c (cols grid)) (if (> c start) (append acc (list (subgrid grid 0 start (- (rows grid) 1) (- c 1)))) acc)) ((all? (lambda (r) (= (at grid r c) 9)) (range 0 (rows grid))) (scan (+ c 1) (+ c 1) (if (> c start) (append acc (list (subgrid grid 0 start (- (rows grid) 1) (- c 1)))) acc))) (else (scan (+ c 1) start acc))))) (define (majority-grid panels) (let ((n (length panels)) (h (rows (first panels))) (w (cols (first panels)))) (grid-from-fn h w (lambda (r c) (let ((hits (length (filter (lambda (p) (not (= (at p r c) 0))) panels)))) (if (>= (* hits 2) n) 1 0)))))) (crop-nonzero (onion-layers (majority-grid (extract-panels g))))))

Provenance

Generator
generators/90fdcc9074f8/generator.py
Notes and decisions
generators/90fdcc9074f8/notes.md
Review label
reviewed_safe
Generator SHA-256
50fea86cbe91231fae2a614b2f2f24c4078dc6b61f355fbf3bb018e6325b886c
Rule hash
19cd475b6d8c
Sources
bank:9cb3cc0a41e6
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 90fdcc9074f8 --count 1 --seed 20261108 --test 1