← d89cff1052a2 · d8ce64d73f8a →
d8b498586958
A color-5 header corner selects union, intersection, XOR, or A-minus-B over two same-size occupancy panels. Four-example lessons cover every corner, and every operand pair makes all four outputs distinct.
header decoding, panel-wise boolean operations, same-size 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! ;; A 9-divider stack: HEADER panel + panels A and B. The header's marked ;; corner picks the boolean op (TL=union, TR=intersect, BL=xor, else A-B); ;; output = op(A, B) painted in 8 on an A-sized canvas. (let () (define (render-same-size cells h w (color 8)) (paint-cells (empty-grid h w 0) (filter (lambda (p) (in-bounds? (first p) (second p) h w)) cells) color)) (define (panel-occ panel) (sort (filter (lambda (p) (let ((v (at panel (first p) (second p)))) (and (not (= v 0)) (not (= v 9))))) (grid-positions panel)) cell<)) (define (split-rows-9 grid) (let loop ((r 0) (start 0) (acc (list))) (cond ((>= r (rows grid)) (reverse (if (< start (rows grid)) (cons (subgrid grid start 0 (- (rows grid) 1) (- (cols grid) 1)) acc) acc))) ((all? (lambda (c) (= (at grid r c) 9)) (range 0 (cols grid))) (let scan ((rr r)) (if (and (< rr (rows grid)) (all? (lambda (c) (= (at grid rr c) 9)) (range 0 (cols grid)))) (scan (+ rr 1)) (loop rr rr (if (< start r) (cons (subgrid grid start 0 (- r 1) (- (cols grid) 1)) acc) acc))))) (else (loop (+ r 1) start acc))))) (define (union-cells panels) (sort (remove-duplicates (flatmap panel-occ panels)) cell<)) (define (inter-cells a b) (let ((bb (panel-occ b))) (filter (lambda (p) (member? p bb)) (panel-occ a)))) (define (minus-cells a b) (let ((bb (panel-occ b))) (filter (lambda (p) (not (member? p bb))) (panel-occ a)))) (define (xor-cells a b) (append (minus-cells a b) (minus-cells b a))) (define (op-from-header header) (let ((cells (panel-occ header))) (cond ((member? (list 0 0) cells) 1) ((member? (list 0 (- (cols header) 1)) cells) 2) ((member? (list (- (rows header) 1) 0) cells) 3) (else 4)))) (let* ((panels (split-rows-9 g)) (header (first panels)) (a (second panels)) (b (third panels)) (op (op-from-header header)) (cells (cond ((= op 1) (union-cells (list a b))) ((= op 2) (inter-cells a b)) ((= op 3) (xor-cells a b)) (else (minus-cells a b))))) (render-same-size cells (rows a) (cols a) 8))))
Provenance
- Generator
- generators/d8b498586958/generator.py
- Notes and decisions
- generators/d8b498586958/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- b5f72638b960c96622d4740f095d12eb103fb2a386c8ce6c84fbbb1489e48f4c
- Rule hash
- 10616a474432
- Sources
- bank:0938460c498b
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate d8b498586958 --count 1 --seed 20261108 --test 1