← 092360ee834f · 094e0794786c →

0938f7c346fb

Infer the unique color-aware binary operation demonstrated by A, B, and RESULT, then apply it cellwise to X and Y. Five equal panels are divided by solid gray separator columns.

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! (let ((dummy 0)) (define (fifth xs) (list-ref xs 4)) (define (split-panels-row grid count) (let* ((panel-w (quotient (- (cols grid) (- count 1)) count))) (for/list ((i (in-range count))) (let ((left (* i (+ panel-w 1)))) (subgrid grid 0 left (- (rows grid) 1) (+ left panel-w -1)))))) (define (merge-op a b) (grid-from-fn (rows a) (cols a) (lambda (r c) (let ((x (at a r c)) (y (at b r c))) (cond ((and (= x 0) (= y 0)) 0) ((= x 0) y) ((= y 0) x) ((= x y) x) (else 9)))))) (define (op-intersection-eq a b) (grid-from-fn (rows a) (cols a) (lambda (r c) (let ((x (at a r c)) (y (at b r c))) (if (and (not (= x 0)) (= x y)) x 0))))) (define (op-xor a b) (grid-from-fn (rows a) (cols a) (lambda (r c) (let ((x (at a r c)) (y (at b r c))) (cond ((and (not (= x 0)) (= y 0)) x) ((and (= x 0) (not (= y 0))) y) (else 0)))))) (define (op-left-minus a b) (grid-from-fn (rows a) (cols a) (lambda (r c) (if (and (not (= (at a r c) 0)) (= (at b r c) 0)) (at a r c) 0)))) (define op-names (list 'intersection-eq 'xor 'left-minus 'conflict-merge)) (define (apply-op name a b) (cond ((equal? name 'intersection-eq) (op-intersection-eq a b)) ((equal? name 'xor) (op-xor a b)) ((equal? name 'left-minus) (op-left-minus a b)) (else (merge-op a b)))) (define (infer-op-name a b result) (first (filter (lambda (name) (equal? (apply-op name a b) result)) op-names))) (let* ((panels (split-panels-row g 5)) (a (first panels)) (b (second panels)) (result (third panels)) (x (fourth panels)) (y (fifth panels)) (op (infer-op-name a b result))) (apply-op op x y))))

Provenance

Generator
generators/0938f7c346fb/generator.py
Notes and decisions
generators/0938f7c346fb/notes.md
Review label
reviewed_safe
Generator SHA-256
0cc830e86e26bf1830cda96f84b6f506930f35e2989a4f1780889057fd557cb2
Rule hash
c2d521df026a
Sources
bank:7507d112faf2
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 0938f7c346fb --count 1 --seed 20261108 --test 1