← 548c1010ce89 · 54b040e4bd08 →

54a83e6bbc20

On a 7 background, match each cyan(8) left jigsaw piece with the unique colored right piece that completes a solid 3x5 rectangle. Right pieces are permuted across 2-4 bands, with equal-area and row-critical shapes; redraw each completed rectangle at column 0.

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! (lambda (g) (let* ((h (rows g)) (w (cols g))) (let* ((bg 7) (lefts (sort-by (filter (lambda (obj) (= (obj-color obj) 8)) (objects g bg)) obj-r1)) (cands (filter (lambda (obj) (!= (obj-color obj) 8)) (objects g bg)))) (define (same-obj? a b) (and (= (obj-r1 a) (obj-r1 b)) (= (obj-c1 a) (obj-c1 b)) (= (obj-color a) (obj-color b)))) (define (shift-cells cells dr dc) (map (lambda (p) (list (+ (first p) dr) (+ (second p) dc))) cells)) (define (member-pos? p cells) (any? (lambda (q) (and (= (first p) (first q)) (= (second p) (second q)))) cells)) (define (disjoint? a b) (not (any? (lambda (p) (member-pos? p b)) a))) (define (solid-rect? cells) (let* ((bb (bbox-of-cells cells)) (r1 (first bb)) (c1 (second bb)) (r2 (third bb)) (c2 (fourth bb)) (rect (positions-in-rect r1 c1 r2 c2))) (and (zero? r1) (zero? c1) (= (length cells) (length rect)) (for/and ((p rect)) (member-pos? p cells))))) (define (placement-candidate lcells ccells0 dr dc) (let* ((ccells (shift-cells ccells0 dr dc)) (allcells (append lcells ccells))) (and (and (disjoint? lcells ccells) (solid-rect? allcells)) (let* ((bb (bbox-of-cells allcells)) (hh (+ 1 (- (third bb) (first bb)))) (ww (+ 1 (- (fourth bb) (second bb))))) (list dr dc hh ww))))) (define (placement left cand) (let* ((lcells (normalize-cells (obj-cells left))) (ccells0 (normalize-cells (obj-cells cand))) (opts (filter (lambda (x) x) (flatmap (lambda (dr) (map (lambda (dc) (placement-candidate lcells ccells0 dr dc)) (range -5 8))) (range -5 6))))) (if (null? opts) #f (first opts)))) (define all-options (filter (lambda (x) x) (flatmap (lambda (left) (map (lambda (cand) (let* ((p (placement left cand))) (and p (list left cand (first p) (second p) (third p) (fourth p))))) cands)) lefts))) (define target-w (mode-list (map sixth all-options))) (define (pick left) (find-first (lambda (opt) (and (same-obj? (first opt) left) (= (sixth opt) target-w))) all-options)) (reduce (lambda (acc left) (let* ((opt (pick left)) (cand (second opt)) (dr (third opt)) (dc (fourth opt)) (r0 (obj-r1 left)) (left-cells (map (lambda (p) (list (+ r0 (first p)) (second p))) (normalize-cells (obj-cells left)))) (cand-cells (map (lambda (p) (list (+ r0 dr (first p)) (+ dc (second p)))) (normalize-cells (obj-cells cand)))) (with-left (paint-cells acc left-cells 8))) (paint-cells with-left cand-cells (obj-color cand)))) (empty-grid h w bg) lefts)))))

Provenance

Generator
generators/54a83e6bbc20/generator.py
Notes and decisions
generators/54a83e6bbc20/notes.md
Review label
reviewed_safe
Generator SHA-256
cca4fcc91281d89167c1720318f997267741052520e441a5266b17ac11b8b95c
Rule hash
82f172ba82d3
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 54a83e6bbc20 --count 1 --seed 20261108 --test 1