← 3799ce10ce15 · 37ef814e99dd →
37aaf7d1e52e
A 0-background grid contains one or more monochrome 4-connected objects. For EACH object, identify every 4-connected background region enclosed inside that object's bounding box. Output only those enclosed cells, colored with the enclosing object's color; erase all object walls, open cavities, solid objects, and other distractors to 0. The curriculum covers rectangular and irregular enclosures, one- and multi-cell holes, multiple holes in one object, multiple enclosing objects with equal or different colors, and non-enclosing distractors.
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 (v0-bbox-height bb) (+ 1 (- (third bb) (first bb)))) (define (v0-bbox-width bb) (+ 1 (- (fourth bb) (second bb)))) (define (v0-touches-border? grid cells) (any? (lambda (p) (or (= (first p) 0) (= (second p) 0) (= (first p) (- (rows grid) 1)) (= (second p) (- (cols grid) 1)))) cells)) (define (v1-holes-of-object obj) (let* ((bb (obj-bbox obj)) (r0 (first bb)) (c0 (second bb)) (h (v0-bbox-height bb)) (w (v0-bbox-width bb)) (mask (for/fold ((m (empty-grid h w 0))) ((p (in-list (obj-cells obj)))) (set-cell m (- (first p) r0) (- (second p) c0) 1))) (regions (find-0-regions mask 0))) (apply append (map (lambda (region) (map (lambda (p) (list (+ r0 (first p)) (+ c0 (second p)))) region)) (filter (lambda (region) (not (v0-touches-border? mask region))) regions))))) (for/fold ((out (empty-grid (rows g) (cols g) 0))) ((obj (in-list (objects g 0)))) (paint-cells out (v1-holes-of-object obj) (obj-color obj)))))
Provenance
- Generator
- generators/37aaf7d1e52e/generator.py
- Notes and decisions
- generators/37aaf7d1e52e/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 4cbb905a4b7ade4f9f395f0cbea2586f666b55a54a2ddd823e9b77e0ffa895e4
- Rule hash
- 7429f4268659
- Sources
- bank:91ced140cdc4
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 37aaf7d1e52e --count 1 --seed 20261108 --test 1