← public_eval_a6f40cea · public_eval_abc82100 →

public_eval_aa4ec2a5

Detect enclosed holes, recolor their entire foreground objects, fill the holes, and add an eight-neighbor exterior outline.

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!
 (let* ((hole-connectivity 4)
        (bg (mode g -1))
        (pieces (objects g bg))
        (cavities
          (lambda (cells)
            (let* ((box (bbox-of-cells cells))
                   (r0 (first box)) (c0 (second box))
                   (h (+ 1 (- (third box) r0))) (w (+ 1 (- (fourth box) c0)))
                   (mask (grid-from-fn h w
                           (lambda (r c) (if (member? (list (+ r r0) (+ c c0)) cells) 1 0))))
                   (regions ((if (= hole-connectivity 4) objects objects-8) mask 1))
                   (closed (filter
                             (lambda (o)
                               (andmap (lambda (p) (and (< 0 (first p) (- h 1))
                                                       (< 0 (second p) (- w 1))))
                                       (obj-cells o))) regions)))
              (map (lambda (p) (list (+ r0 (first p)) (+ c0 (second p))))
                   (apply append (map obj-cells closed))))))
        (classified (map (lambda (o) (let ((cells (obj-cells o)))
                                      (list cells (cavities cells)))) pieces))
        (holes (apply append (map second classified)))
        (holed-cells (apply append (map first
                        (filter (lambda (record) (not (empty? (second record)))) classified))))
        (support (append (apply append (map first classified)) holes))
        (rim (remove-duplicates
               (apply append
                 (map (lambda (p)
                        (for*/list ((dr (in-range -1 2)) (dc (in-range -1 2)))
                          (list (+ (first p) dr) (+ (second p) dc)))) support)))))
   (grid-from-fn (rows g) (cols g)
     (lambda (r c)
       (let ((p (list r c)))
         (cond ((member? p holes) 6)
               ((member? p holed-cells) 8)
               ((not (= (at g r c) bg)) (at g r c))
               ((member? p rim) 2)
               (else bg)))))))

Provenance

Generator
generators/public_eval_aa4ec2a5/generator.py
Notes and decisions
generators/public_eval_aa4ec2a5/notes.md
Review label
reviewed_safe
Generator SHA-256
313ba98dfb80853dad217e180d40c5e0b4a3f7db86376fe5b086a3462ade2b04
Rule hash
41fa9a387754
Sources
evaluation, public_eval:aa4ec2a5
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_aa4ec2a5 --count 1 --seed 20261108 --test 1