← d7c15b2e56ec · d8111f3f714d →

d7f13ee34d85

Pair 2-4 hollow frames by increasing interior area with equally many loose connected shapes by increasing cell count. Center using signed floor-half offsets, including border overlap. Shared or distinct frame colors, unequal rectangular interiors, and variable shape counts occur in ordinary lessons.

containmentmatchingsorting

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 (floor-half x)
      (if (>= x 0) (quotient x 2) (- 0 (quotient (+ (- 0 x) 1) 2))))
    (define objs (objects g 0))
    (define frames
      (sort (filter frame? objs)
            (lambda (a b)
              (< (* (- (obj-r2 a) (obj-r1 a) 1) (- (obj-c2 a) (obj-c1 a) 1))
                 (* (- (obj-r2 b) (obj-r1 b) 1) (- (obj-c2 b) (obj-c1 b) 1))))))
    (define shapes (sort (filter (lambda (obj) (not (frame? obj))) objs)
                         (lambda (a b) (< (obj-size a) (obj-size b)))))
    (define with-frames
      (for/fold ([out (empty-grid (rows g) (cols g) 0)]) ([frame (in-list frames)])
        (paint-cells out (obj-cells frame) (obj-color frame))))
    (for/fold ([out with-frames]) ([frame (in-list frames)] [obj (in-list shapes)])
      (let* ((shape (subgrid g (obj-r1 obj) (obj-c1 obj) (obj-r2 obj) (obj-c2 obj)))
             (top (+ (obj-r1 frame) 1 (floor-half (- (- (obj-r2 frame) (obj-r1 frame) 1) (rows shape)))))
             (left (+ (obj-c1 frame) 1 (floor-half (- (- (obj-c2 frame) (obj-c1 frame) 1) (cols shape))))))
        (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 (+ top r) (+ left c) v) acc)))))))

Provenance

Generator
generators/d7f13ee34d85/generator.py
Notes and decisions
generators/d7f13ee34d85/notes.md
Review label
reviewed_safe
Generator SHA-256
a959a4c428fb47a179bc9fccd12468dda172a45f18079952aa2630531833bd9d
Rule hash
435fa9a55dd3
Sources
bank:276b5e4c56a1
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate d7f13ee34d85 --count 1 --seed 20261108 --test 1