← 397767b9f88c · 399643e39cf6 →

3977ec54e4a0

A noisy {0,1} grid contains 1..4 disconnected color-3 chevrons. Each chevron is an apex plus at least one marker on each of its two diagonal arms; interior arm markers may be absent and the two arms may be asymmetric. For every supported chevron, fill its solid triangular wedge with color 8, preserving all color-3 markers and all outside background cells.

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!
 ;; Green(3) marks sketch V-shaped triangles: an apex plus points along its
 ;; two 45-degree arms (grouped when within Chebyshev distance 2 along a
 ;; row, column, or exact diagonal). For every group, apex, depth and
 ;; orientation where both arms are attested (>=1 mark each, >=3 total,
 ;; and some mark sits at full depth), the whole solid triangle is filled
 ;; with cyan(8). The marks themselves stay green.
 (lambda (g)
   (let ()
     (define marks (find-color g 3))
     (define max-d (max h w))
     (define (near? a b)  ;; aligned or diagonal within Chebyshev 2
       (let ((dr (abs (- (first a) (first b))))
             (dc (abs (- (second a) (second b)))))
         (and (<= (max dr dc) 2)
              (or (= dr dc) (zero? dr) (zero? dc)))))
     (define groups  ;; connected components of marks under near?
       (for/fold ((gs (list))) ((m marks))
         (let ((touch? (lambda (grp) (any? (lambda (x) (near? m x)) grp))))
           (cons (cons m (apply append (filter touch? gs)))
                 (filter (lambda (grp) (not (touch? grp))) gs)))))
     (define (arm-cell orient ar ac k side)  ;; k-th cell of one arm
       (cond ((zero? orient) (list (+ ar k) (+ ac (if (zero? side) (- k) k))))
             ((= orient 1) (list (- ar k) (+ ac (if (zero? side) (- k) k))))
             ((= orient 2) (list (+ ar (if (zero? side) (- k) k)) (+ ac k)))
             (else (list (+ ar (if (zero? side) (- k) k)) (- ac k)))))
     (define (arm-count orient ar ac d side grp)
       (count-if (lambda (k)
                   (let ((p (arm-cell orient ar ac k side)))
                     (and (in-bounds? (first p) (second p) h w)
                          (member? p grp))))
                 (range 1 (+ d 1))))
     (define (far-supported? orient ar ac d grp)
       (any? (lambda (side)
               (let ((p (arm-cell orient ar ac d side)))
                 (and (in-bounds? (first p) (second p) h w)
                      (member? p grp))))
             (list 0 1)))
     (define (valid? orient apex d grp)
       (let ((a (arm-count orient (first apex) (second apex) d 0 grp))
             (b (arm-count orient (first apex) (second apex) d 1 grp)))
         (and (>= (+ 1 a b) 3) (>= a 1) (>= b 1)
              (far-supported? orient (first apex) (second apex) d grp))))
     (define tris  ;; every attested (orient apex d), over all groups
       (flatmap (lambda (grp)
                  (flatmap (lambda (apex)
                             (flatmap (lambda (d)
                                        (filter values
                                                (map (lambda (orient)
                                                       (and (valid? orient apex d grp)
                                                            (list orient apex d)))
                                                     (list 0 1 2 3))))
                                      (range 1 (+ max-d 1))))
                           grp))
                groups))
     (define (inside? orient apex d r c)  ;; cell within the solid triangle
       (let ((ar (first apex)) (ac (second apex)))
         (cond ((zero? orient)
                (and (>= r ar) (<= r (+ ar d))
                     (<= (abs (- c ac)) (- r ar))))
               ((= orient 1)
                (and (<= r ar) (>= r (- ar d))
                     (<= (abs (- c ac)) (- ar r))))
               ((= orient 2)
                (and (>= c ac) (<= c (+ ac d))
                     (<= (abs (- r ar)) (- c ac))))
               (else
                (and (<= c ac) (>= c (- ac d))
                     (<= (abs (- r ar)) (- ac c)))))))
     (cellmap g (r c v)
       (if (and (!= v 3)
                (any? (lambda (t)
                        (inside? (first t) (second t) (third t) r c))
                      tris))
           8 v)))))

Provenance

Generator
generators/3977ec54e4a0/generator.py
Notes and decisions
generators/3977ec54e4a0/notes.md
Review label
reviewed_safe
Generator SHA-256
406ea39bd1050f238678d02ce90c50e02a8dd6e24e214d739398783ec7c5e603
Rule hash
780d64b3096e
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 3977ec54e4a0 --count 1 --seed 20261108 --test 1