← c4d63d8b4567 · c53c24435976 →

c4f6a0585dbf

0-bg 23x23 with ONE solid color-1 rectangle (2..3 interior color-4 ports) plus 17..47 scattered color-4 cells; the rule stamps the template's 1-cells wherever a D4 transform aligns >=2 ports.

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! (lambda (g)
         (let* ((h (rows g))
                (w (cols g)))
           (begin
             (define ones (positions-of g (lambda (v) (= v 1))))
             (define r0 (min-of first ones))
             (define r1 (max-of first ones))
             (define c0 (min-of second ones))
             (define c1 (max-of second ones))
             (define base
               (filter identity
                       (for*/list ((r (range r0 (+ r1 1))) (c (range c0 (+ c1 1))))
                         (let ((v (at g r c)))
                           (and (or (= v 1) (= v 4)) (list (- r r0) (- c c0) v))))))
             (define all4 (positions-of g (lambda (v) (= v 4))))
             (define (transform-pos p idx)
               (let ((r (first p))
                     (c (second p)))
                 (cond
                   ((zero? idx) (list r c))
                   ((= idx 1) (list c (- r)))
                   ((= idx 2) (list (- r) (- c)))
                   ((= idx 3) (list (- c) r))
                   ((= idx 4) (list r (- c)))
                   ((= idx 5) (list (- c) (- r)))
                   ((= idx 6) (list (- r) c))
                   (else (list c r)))))
             (define (entries-after idx)
               (let* ((raws (map (lambda (e) (transform-pos e idx)) base))
                      (mr (min-of first raws))
                      (mc (min-of second raws)))
                 (map (lambda (e)
                        (let ((p (transform-pos e idx)))
                          (list (- (first p) mr) (- (second p) mc) (third e))))
                      base)))
             (define (valid-candidate? entries ar ac)
               (let* ((placed4 (filter (lambda (p)
                                         (in-bounds? (first p) (second p) h w))
                                       (map (lambda (e)
                                              (list (+ ar (first e)) (+ ac (second e))))
                                            (filter (lambda (e) (= (third e) 4))
                                                    entries))))
                      (placed1 (filter (lambda (p)
                                         (in-bounds? (first p) (second p) h w))
                                       (map (lambda (e)
                                              (list (+ ar (first e)) (+ ac (second e))))
                                            (filter (lambda (e) (= (third e) 1))
                                                    entries)))))
                 (and
                   (>= (length placed4) 2)
                   (for/and ((p placed4)) (member p all4))
                   (for/and ((p placed1))
                            (let ((v (at g (first p) (second p))))
                              (or (zero? v) (= v 1)))))))
             (define candidates
               (flatmap (lambda (idx)
                          (let* ((entries (entries-after idx))
                                 (maxr (max-of first entries))
                                 (maxc (max-of second entries)))
                            (filter identity
                                    (for*/list ((ar (range (- maxr) h)) (ac (range (- maxc) w)))
                                      (and
                                        (valid-candidate? entries ar ac)
                                        (map (lambda (e)
                                               (list (+ ar (first e)) (+ ac (second e))))
                                             (filter (lambda (e) (= (third e) 1))
                                                     entries)))))))
                        (range 0 8)))
             (for/fold ((out g))
               ((cells candidates))
               (for/fold ((gg out))
                 ((p cells))
                 (if (and
                       (in-bounds? (first p) (second p) h w)
                       (zero? (at g (first p) (second p))))
                     (set-cell gg (first p) (second p) 1)
                     gg)))))))

Provenance

Generator
generators/c4f6a0585dbf/generator.py
Notes and decisions
generators/c4f6a0585dbf/notes.md
Review label
reviewed_safe
Generator SHA-256
0923abd70712d9c2140d793b64900d1024f1bba9f8b382dd5af3870192e02831
Rule hash
d401b3cd92ff
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate c4f6a0585dbf --count 1 --seed 20261108 --test 1