← 0ab4fcb302d2 · 0ae0d5780419 →

0ab5dc1f5386

Color-8 rectangular frames receive the first unused loose component whose cropped bbox exactly matches the frame interior; source components remain. A four-example schedule teaches orientation-sensitive size matching, scan-order tie breaking, value-equality one-use, and multicolor preservation.

parametric familyframe detectionplacement by fitsize matching

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).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define (nonzero-components grid)
      (let loop ([remaining (filter-cells grid (lambda (r c v) (not (= v 0))))] [acc (list)])
        (if (empty? remaining)
            (reverse acc)
            (let* ((start (first remaining))
                   (cells (connected-region grid (first start) (second start)
                            (lambda (r c v) (not (= v 0))) 4)))
              (loop (filter (lambda (p) (not (member? p cells))) remaining)
                    (cons cells acc))))))
    (define (rect-frame? obj)
      (= (obj-size obj) (- (* 2 (+ (obj-h obj) (obj-w obj))) 4)))
    (define (crop-cells cells)
      (let ((bb (bbox-of-cells cells)))
        (subgrid g (first bb) (second bb) (third bb) (fourth bb))))
    (let* ((frames (sort (map obj-bbox (filter (lambda (obj)
                                                 (and (= (obj-color obj) 8) (rect-frame? obj)))
                                               (objects g 0)))
                         (lambda (a b)
                           (if (= (first a) (first b))
                               (< (second a) (second b))
                               (< (first a) (first b))))))
           (shapes (filter (lambda (cells)
                             (not (= (at g (first (first cells)) (second (first cells))) 8)))
                           (nonzero-components g)))
           (shape-info (map (lambda (cells)
                              (let ((block (crop-cells cells)))
                                (list (rows block) (cols block) block)))
                            shapes)))
      (let loop-frames ([out g] [remaining frames] [used (list)])
        (if (empty? remaining)
            out
            (let* ((fr (first remaining))
                   (ih (- (third fr) (first fr) 1))
                   (iw (- (fourth fr) (second fr) 1))
                   (match (find-first
                            (lambda (item)
                              (and (= (first item) ih) (= (second item) iw)
                                   (not (member? item used))))
                            shape-info)))
              (if (eq? match #f)
                  (loop-frames out (rest remaining) used)
                  (let ((block (third match)))
                    (loop-frames
                      (for*/fold ([acc out])
                                 ([r (in-range (rows block))]
                                  [c (in-range (cols block))]
                                  #:when (not (= (at block r c) 0)))
                        (set-cell acc (+ (first fr) 1 r) (+ (second fr) 1 c) (at block r c)))
                      (rest remaining)
                      (cons match used))))))))))

Provenance

Generator
generators/0ab5dc1f5386/generator.py
Notes and decisions
generators/0ab5dc1f5386/notes.md
Review label
reviewed_safe
Generator SHA-256
a4b6e6fe9ddca55ec8349902dc6ae62d3b0a81b757c9bcb7e4ce401b083ad897
Rule hash
1529a4ef373b
Sources
bank:868e1a8cbe17
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 0ab5dc1f5386 --count 1 --seed 20261108 --test 1