← b4d9320e0d9d · b570c79ec730 →

b4ecb537757c

Match each intact monochrome frame to its external same-color insert. An isolated interior key selects identity (1), clockwise (2), half-turn (3), or counterclockwise (4). The unchanged reference clears the input, retains complete frames, and pastes transformed insert subgrids at each frame's interior top left. Generated transformed inserts fit completely. One-frame 7x12 three-color scenes alternate with varied multi-frame scenes.

framesmatchingrotationsame_size

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 (frame? obj)
      (let* ((h (obj-h obj)) (w (obj-w obj))
             (border-size (- (* h w) (* (max 0 (- h 2)) (max 0 (- w 2))))))
        (and (>= h 3) (>= w 3) (= (obj-size obj) border-size)
             (all? (lambda (p)
                     (or (= (first p) (obj-r1 obj)) (= (first p) (obj-r2 obj))
                         (= (second p) (obj-c1 obj)) (= (second p) (obj-c2 obj))))
                   (obj-cells obj)))))
    (define (transform shape key)
      (if (= key 1) shape (if (= key 2) (rotate-cw shape) (if (= key 3) (rotate-180 shape) (rotate-ccw shape)))))
    (define objs (objects g 0))
    (define frames (filter frame? objs))
    (define inserts (filter (lambda (obj) (and (not (frame? obj)) (> (obj-size obj) 1))) objs))
    (define singles (filter (lambda (obj) (and (= (obj-size obj) 1) (member (obj-color obj) (list 1 2 3 4)))) objs))
    (define with-frames
      (for/fold ([out (empty-grid (rows g) (cols g) 0)]) ([fr (in-list frames)])
        (paint-cells out (obj-cells fr) (obj-color fr))))
    (for/fold ([out with-frames]) ([fr (in-list frames)])
      (let* ((key-candidates (filter (lambda (s)
                                       (let ((p (first (obj-cells s))))
                                         (and (> (first p) (obj-r1 fr)) (< (first p) (obj-r2 fr))
                                              (> (second p) (obj-c1 fr)) (< (second p) (obj-c2 fr)))))
                                     singles))
             (key (if (empty? key-candidates) 1 (obj-color (first key-candidates))))
             (insert (first (filter (lambda (obj) (= (obj-color obj) (obj-color fr))) inserts)))
             (shape (transform (subgrid g (obj-r1 insert) (obj-c1 insert) (obj-r2 insert) (obj-c2 insert)) key)))
        (for*/fold ([acc out])
                   ([r (in-range (rows shape))]
                    [c (in-range (cols shape))])
          (let ((v (at shape r c)))
            (if (not (= v 0)) (set-cell acc (+ (obj-r1 fr) 1 r) (+ (obj-c1 fr) 1 c) v) acc)))))))

Provenance

Generator
generators/b4ecb537757c/generator.py
Notes and decisions
generators/b4ecb537757c/notes.md
Review label
reviewed_safe
Generator SHA-256
5dcb55bec544f478c1c7c366e680a60e678799b4669103deb2ef74cce781f467
Rule hash
1232696ab606
Sources
bank:a54e1d9e1d4b
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate b4ecb537757c --count 1 --seed 20261108 --test 1