← 192d2bc2de61 · 196a7ec58bbc →

195dfcc5b541

Dense 0/2/3/4/7 noise contains one color-8 chiral stencil and two to four isolated color-3 dihedral copies. At least one copy is a true reflection, so rotations-only rules fail; the selected Racket rule recolors all matching copy cells to 8.

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 (norm cells)
               (let* ((rs (map first cells))
                      (cs (map second cells))
                      (r0 (min-list rs))
                      (c0 (min-list cs)))
                 (sort (map (lambda (p) (list (- (first p) r0) (- (second p) c0)))
                            cells)
                       (lambda (a b)
                         (or
                           (< (first a) (first b))
                           (and (= (first a) (first b)) (< (second a) (second b))))))))
             (define (rot cells)
               (norm (map (lambda (p) (list (second p) (- (first p)))) cells)))
             (define (flip cells)
               (norm (map (lambda (p) (list (first p) (- (second p)))) cells)))
             (define (shape-h shape) (+ 1 (max-of first shape)))
             (define (shape-w shape) (+ 1 (max-of second shape)))
             (define matches (list))
             (for ((obj (objects-8 g 0)))
               (when
                 (= (obj-color obj) 8)
                 (define base (norm (obj-cells obj)))
                 (define r1 (rot base))
                 (define r2 (rot r1))
                 (define r3 (rot r2))
                 (define variants
                   (list (list 0 base)
                         (list 0 r1)
                         (list 0 r2)
                         (list 0 r3)
                         (list 1 (flip base))
                         (list 1 (flip r1))
                         (list 1 (flip r2))
                         (list 1 (flip r3))))
                 (for ((var variants))
                   (define flip-rank (first var))
                   (define shape (second var))
                   (define mh (shape-h shape))
                   (define mw (shape-w shape))
                   (for* ((r0 (range 0 (+ 1 (- h mh)))) (c0 (range 0 (+ 1 (- w mw)))))
                         (define cells
                           (map (lambda (p) (list (+ r0 (first p)) (+ c0 (second p))))
                                shape))
                         (when
                           (for/and ((p cells)) (= (at g (first p) (second p)) 3))
                           (set! matches (cons (list flip-rank r0 c0 cells) matches)))))))
             (define sorted-matches
               (sort matches
                     (lambda (a b)
                       (cond
                         ((< (first a) (first b)) #t)
                         ((> (first a) (first b)) #f)
                         ((< (second a) (second b)) #t)
                         ((> (second a) (second b)) #f)
                         (else (< (third a) (third b)))))))
             (define used (make-hash))
             (for/fold ((out g))
               ((m sorted-matches))
               (define cells (fourth m))
               (if (for/or ((p cells)) (hash-has-key? used p))
                   out
                   (begin
                     (for ((p cells)) (hash-set! used p #t))
                     (paint-cells out cells 8))))))))

Provenance

Generator
generators/195dfcc5b541/generator.py
Notes and decisions
generators/195dfcc5b541/notes.md
Review label
reviewed_safe
Generator SHA-256
af8350048eca44100de1d539ba7bb3f295bb82cbf99411f7eef218c4c1e56ed7
Rule hash
22e420574f26
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 195dfcc5b541 --count 1 --seed 20261108 --test 1