← public_eval_38007db0 · public_eval_3dc255db →

public_eval_3a25b0d8

Public 3a25b0d8: isolate figures and transfer spatially matched cavity colors.

parametric family

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!
 ;; Two disconnected figures share an outline color. One is a colored guide;
 ;; the other is an uncolored target whose enclosed cavities may be deformed.
 ;; Isolate each 8-connected figure before cropping (their bounding boxes can
 ;; overlap). Extract its four-connected enclosed non-outline regions. Match
 ;; regions in spatial order: bounding-box center row, then center column.
 ;; Transfer each guide region's color to the corresponding target cavity;
 ;; preserve the target outline and exterior, returning its tight bounding box.
 (lambda (g)
  (let ()
   (define bg (mode g -1))
   (define figures (objects-multicolor g bg))
   (define (colors obj)
    (remove-duplicates (map (lambda (p) (at g (first p) (second p))) (obj-cells obj))))
   (define target-object (first (filter (lambda (o) (= (length (colors o)) 1)) figures)))
   (define guide-object (first (filter (lambda (o) (> (length (colors o)) 1)) figures)))
   (define wall (first (colors target-object)))
   (define (isolated-crop obj)
    (build-grid (obj-h obj) (obj-w obj) (r c)
     (let ((p (list (+ (obj-r1 obj) r) (+ (obj-c1 obj) c))))
      (if (member p (obj-cells obj)) (at g (first p) (second p)) bg))))
   (define guide (isolated-crop guide-object))
   (define target (isolated-crop target-object))
   (define (region<? a b)
    (let* ((aa (bbox-of-cells a)) (bb (bbox-of-cells b))
           (ay (+ (first aa) (third aa))) (by (+ (first bb) (third bb)))
           (ax (+ (second aa) (fourth aa))) (bx (+ (second bb) (fourth bb))))
     (if (= ay by) (< ax bx) (< ay by))))
   (define (cavities canvas)
    (sort
     (filter
      (lambda (cells)
       (andmap (lambda (p) (and (> (first p) 0) (> (second p) 0)
                                (< (first p) (- (rows canvas) 1))
                                (< (second p) (- (cols canvas) 1)))) cells))
      (find-0-regions (cellmap canvas (r c v) (if (= v wall) wall bg)) bg))
     region<?))
   (define guide-regions (cavities guide))
   (define target-regions (cavities target))
   ;; Parallel clauses deliberately zip the already matched region lists.
   (for/fold ((out target)) ((source-region guide-regions) (target-region target-regions))
    (let ()
     (define paint? #t)
     (define color (at guide (first (first source-region)) (second (first source-region))))
     (if paint? (recolor-cells out target-region color) out))))))

Provenance

Generator
generators/public_eval_3a25b0d8/generator.py
Notes and decisions
generators/public_eval_3a25b0d8/notes.md
Review label
reviewed_safe
Generator SHA-256
29259f0ca51f1eac519346629957a749c502af81bd1ad0ec3c436ec2cd79ce28
Rule hash
b1acc094ab2b
Sources
evaluation, public_eval:3a25b0d8
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_3a25b0d8 --count 1 --seed 20261108 --test 1