← 4d5bb3c0250b · 4dd0b3ed33ee →
4dd02f124024
Keep nonzero contents when every interior color matches its rectangular frame; otherwise erase all nonzero contents inside that frame.
containmentframe_content_relation
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 (scan-frames grid) (define (border-ok? r0 c0 r1 c1 col) (and (not (= col 0)) (all? (lambda (c) (and (= (at grid r0 c) col) (= (at grid r1 c) col))) (range c0 (+ c1 1))) (all? (lambda (r) (and (= (at grid r c0) col) (= (at grid r c1) col))) (range r0 (+ r1 1))))) (filter (lambda (x) (not (eq? x #f))) (for*/list ((r0 (in-range 0 (- (rows grid) 2))) (c0 (in-range 0 (- (cols grid) 2))) (r1 (in-range (+ r0 2) (rows grid))) (c1 (in-range (+ c0 2) (cols grid)))) (let ((col (at grid r0 c0))) (if (border-ok? r0 c0 r1 c1 col) (list col r0 c0 r1 c1 (* (- r1 r0 1) (- c1 c0 1))) #f))))) (for/fold ((out g)) ((fr (in-list (scan-frames g)))) (let* ((r0 (second fr)) (c0 (third fr)) (r1 (fourth fr)) (c1 (list-ref fr 4)) (color (first fr)) (inner (positions-in-rect (+ r0 1) (+ c0 1) (- r1 1) (- c1 1))) (inner-cells (filter (lambda (p) (not (= (at out (first p) (second p)) 0))) inner)) (inner-colors (remove-duplicates (map (lambda (p) (at out (first p) (second p))) inner-cells)))) (if (and (not (empty? inner-cells)) (or (not (= (length inner-colors) 1)) (not (= (first inner-colors) color)))) (paint-cells out inner-cells 0) out)))))
Provenance
- Generator
- generators/4dd02f124024/generator.py
- Notes and decisions
- generators/4dd02f124024/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 7132022847bd5b3b9059ee33a52ced1416673a5061b82e04acd7ec20cbff1be9
- Rule hash
- 1ded33eac0b5
- Sources
- bank:037ff40eee92
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 4dd02f124024 --count 1 --seed 20261108 --test 1